# Assign a Credential to an ACS User

* [Request Parameters](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/api/acs/credentials/..#request-parameters)
* [Response](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/api/acs/credentials/..#response)
* [Examples](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/api/acs/credentials/..#examples)

Assigns a specified [credential](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/access-systems/managing-credentials) to a specified [access system user](https://docs.seam.co/latest/capability-guides/access-systems/user-management).

{% tabs %}
{% tab title="Signature" %}

```
PATCH /acs/credentials/assign ⇒ void
```

{% endtab %}
{% endtabs %}

<details>

<summary>Authentication Methods</summary>

* API key
* Personal access token\
  Must also include the `seam-workspace` header in the request.

To learn more, see [Authentication](https://docs.seam.co/latest/api/authentication).

</details>

## Request Parameters

**`acs_credential_id`** *String* (Required)

ID of the credential that you want to assign to an access system user.

***

**`acs_user_id`** *String*

ID of the access system user to whom you want to assign a credential. You can only provide one of acs\_user\_id or user\_identity\_id.

***

**`user_identity_id`** *String*

ID of the user identity to whom you want to assign a credential. You can only provide one of acs\_user\_id or user\_identity\_id. If the ACS system contains an ACS user with the same `email_address` or `phone_number` as the user identity that you specify, they are linked, and the credential belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created.

***

## Response

void

***

## Examples

### Assign a credential to an ACS user

Specify the desired `acs_user_id` and `acs_credential_id` to assign a credential to an ACS user.

{% tabs %}
{% tab title="JavaScript" %}
**Code**

```javascript
await seam.acs.credentials.assign({
  acs_user_id: "33333333-3333-3333-3333-333333333333",
  acs_credential_id: "66666666-6666-6666-6666-666666666666",
});
```

**Output**

```javascript
// void
```

{% endtab %}

{% tab title="Python" %}
**Code**

```python
seam.acs.credentials.assign(
    acs_user_id="33333333-3333-3333-3333-333333333333",
    acs_credential_id="66666666-6666-6666-6666-666666666666",
)
```

**Output**

```python
None
```

{% endtab %}

{% tab title="Ruby" %}
**Code**

```ruby
seam.acs.credentials.assign(
  acs_user_id: "33333333-3333-3333-3333-333333333333",
  acs_credential_id: "66666666-6666-6666-6666-666666666666",
)
```

**Output**

```ruby
nil
```

{% endtab %}

{% tab title="PHP" %}
**Code**

```php
<?php
$seam->acs->credentials->assign(
    acs_user_id: "33333333-3333-3333-3333-333333333333",
    acs_credential_id: "66666666-6666-6666-6666-666666666666"
);
```

**Output**

```php
null
```

{% endtab %}

{% tab title="Seam CLI" %}
**Code**

```seam_cli
seam acs credentials assign --acs_user_id "33333333-3333-3333-3333-333333333333" --acs_credential_id "66666666-6666-6666-6666-666666666666"
```

**Output**

```seam_cli
{}
```

{% endtab %}

{% tab title="Go" %}
**Code**

```go
package main

import api "github.com/seamapi/go"
import credentials "github.com/seamapi/go/credentials"

func main() {
	client.Acs.Credentials.Assign(
		context.Background(),
		credentials.CredentialsAssignRequest{
			AcsUserId:       api.String("33333333-3333-3333-3333-333333333333"),
			AcsCredentialId: api.String("66666666-6666-6666-6666-666666666666"),
		},
	)
}
```

**Output**

```go
nil
```

{% endtab %}

{% tab title="cURL" %}
**Code**

```curl
curl --include --request POST "https://connect.getseam.com/acs/credentials/assign" \
  --header "Authorization: Bearer $SEAM_API_KEY" \
  --json @- <<EOF
{
  "acs_user_id": "33333333-3333-3333-3333-333333333333",
  "acs_credential_id": "66666666-6666-6666-6666-666666666666"
}
EOF
```

**Output**

```curl
{}
```

{% endtab %}
{% endtabs %}
