# Assigning Credentials to ACS Users

This guide explains how to assign existing [credentials](https://github.com/seamapi/docs/blob/main/docs/guides/capability-guides/access-systems/managing-credentials/README.md) to [ACS users](/latest/capability-guides/access-systems/user-management.md) and unassign credentials from users. Once you assign credentials to ACS users, these users can use the credentials to access areas and resources according to their permissions. When you unassign credentials from ACS users, these users can no longer use these specific credentials to access areas or resources.

***

## Assign a Credential to an ACS User

To [assign a credential to an ACS user](https://docs.seam.co/latest/api/acs/credentials/assign), provide both the `acs_user_id` and the `acs_credential_id`.

{% tabs %}
{% tab title="JavaScript" %}
**Request:**

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

**Response:**

{% hint style="info" %}
This response contains manufacturer-specific metadata that may vary by [manufacturer](https://docs.seam.co/latest/device-and-system-integration-guides#access-control-systems).
{% endhint %}

```json
{
  acs_credential_id: '99999999-9999-9999-9999-999999999999',
  acs_user_id: '33333333-3333-3333-3333-333333333333',
  display_name: 'Multi Phone Sync Credential',
  code: null,
  acs_system_id: '11111111-1111-1111-1111-111111111111',
  access_method: 'mobile_key',
  workspace_id: '00000000-0000-0000-0000-000000000000',
  created_at: '2024-04-12T03:56:22.396Z',
  is_multi_phone_sync_credential: true,
  // manufacturer-specific metadata
}
```

{% endtab %}

{% tab title="cURL" %}
**Request:**

```bash
curl -X 'POST' \
  'https://connect.getseam.com/acs/credentials/assign' \
  -H "Authorization: Bearer ${API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
  "acs_user_id": "33333333-3333-3333-3333-333333333333",
  "acs_credential_id": "66666666-6666-6666-6666-666666666666"
}'
```

**Response:**

{% hint style="info" %}
This response contains manufacturer-specific metadata that may vary by [manufacturer](https://docs.seam.co/latest/device-and-system-integration-guides#access-control-systems).
{% endhint %}

```json
{
  "acs_credential": {
    "acs_credential_id": "99999999-9999-9999-9999-999999999999",
    "acs_user_id": "33333333-3333-3333-3333-333333333333",
    "display_name": "Multi Phone Sync Credential",
    "code": null,
    "acs_system_id": "11111111-1111-1111-1111-111111111111",
    "access_method": "mobile_key",
    "workspace_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2024-04-12T03:56:22.396Z",
    "is_multi_phone_sync_credential": true,
    # manufacturer-specific metadata
  },
  "ok": true
}
```

{% endtab %}

{% tab title="Python" %}
**Request:**

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

**Response:**

{% hint style="info" %}
This response contains manufacturer-specific metadata that may vary by [manufacturer](https://docs.seam.co/latest/device-and-system-integration-guides#access-control-systems).
{% endhint %}

```
AcsCredential(
  acs_credential_id='99999999-9999-9999-9999-999999999999',
  acs_user_id='33333333-3333-3333-3333-333333333333',
  display_name='Multi Phone Sync Credential',
  code=null,
  acs_system_id='11111111-1111-1111-1111-111111111111',
  access_method='mobile_key',
  workspace_id='00000000-0000-0000-0000-000000000000',
  created_at='2024-04-12T03:56:22.396Z',
  is_multi_phone_sync_credential=True,
  # manufacturer-specific metadata
)
```

{% endtab %}

{% tab title="Ruby" %}
**Request:**

```ruby
# Coming soon!
```

**Response:**

```
# Coming soon!
```

{% endtab %}

{% tab title="PHP" %}
**Request:**

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

**Response:**

{% hint style="info" %}
This response contains manufacturer-specific metadata that may vary by [manufacturer](https://docs.seam.co/latest/device-and-system-integration-guides#access-control-systems).
{% endhint %}

```json
{
  "acs_credential_id": "99999999-9999-9999-9999-999999999999",
  "acs_user_id": "33333333-3333-3333-3333-333333333333",
  "display_name": "Multi Phone Sync Credential",
  "code": null,
  "acs_system_id": "11111111-1111-1111-1111-111111111111",
  "access_method": "mobile_key",
  "workspace_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2024-04-12T03:56:22.396Z",
  "is_multi_phone_sync_credential": true,
  // manufacturer-specific metadata
}
```

{% endtab %}

{% tab title="C#" %}
**Request:**

```csharp
seam.CredentialsAcs.Assign(
  acsUserId: "33333333-3333-3333-3333-333333333333",
  acsCredentialId: "66666666-6666-6666-6666-66666666"
);
```

**Response:**

{% hint style="info" %}
This response contains manufacturer-specific metadata that may vary by [manufacturer](https://docs.seam.co/latest/device-and-system-integration-guides#access-control-systems).
{% endhint %}

```json
{
  "acs_credential_id": "99999999-9999-9999-9999-999999999999",
  "acs_user_id": "33333333-3333-3333-3333-333333333333",
  "display_name": "Multi Phone Sync Credential",
  "code": null,
  "acs_system_id": "11111111-1111-1111-1111-111111111111",
  "access_method": "mobile_key",
  "workspace_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2024-04-12T03:56:22.396Z",
  "is_multi_phone_sync_credential": true,
  // manufacturer-specific metadata
}
```

{% endtab %}
{% endtabs %}

***

## Unassign a Credential from an ACS User

To [unassign a credential from an ACS user](https://docs.seam.co/latest/api/acs/credentials/unassign), provide both the `acs_user_id` and the `acs_credential_id`.

{% tabs %}
{% tab title="JavaScript" %}
**Request:**

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

**Response:**

{% hint style="info" %}
This response contains manufacturer-specific metadata that may vary by [manufacturer](https://docs.seam.co/latest/device-and-system-integration-guides#access-control-systems).
{% endhint %}

```json
{
  acs_credential_id: '99999999-9999-9999-9999-999999999999',
  acs_user_id: '33333333-3333-3333-3333-333333333333',
  display_name: 'Multi Phone Sync Credential',
  code: null,
  acs_system_id: '11111111-1111-1111-1111-111111111111',
  access_method: 'mobile_key',
  workspace_id: '00000000-0000-0000-0000-000000000000',
  created_at: '2024-04-12T03:56:22.396Z',
  is_multi_phone_sync_credential: true,
  // manufacturer-specific metadata
}
```

{% endtab %}

{% tab title="cURL" %}
**Request:**

```bash
curl -X 'POST' \
  'https://connect.getseam.com/acs/credentials/unassign' \
  -H "Authorization: Bearer ${API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
  "acs_user_id": "33333333-3333-3333-3333-333333333333",
  "acs_credential_id": "66666666-6666-6666-6666-666666666666"
}'
```

**Response:**

{% hint style="info" %}
This response contains manufacturer-specific metadata that may vary by [manufacturer](https://docs.seam.co/latest/device-and-system-integration-guides#access-control-systems).
{% endhint %}

```json
{
  "acs_credential": {
    "acs_credential_id": "99999999-9999-9999-9999-999999999999",
    "acs_user_id": "33333333-3333-3333-3333-333333333333",
    "display_name": "Multi Phone Sync Credential",
    "code": null,
    "acs_system_id": "11111111-1111-1111-1111-111111111111",
    "access_method": "mobile_key",
    "workspace_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2024-04-12T03:56:22.396Z",
    "is_multi_phone_sync_credential": true,
    # manufacturer-specific metadata
  },
  "ok": true
}
```

{% endtab %}

{% tab title="Python" %}
**Request:**

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

**Response:**

{% hint style="info" %}
This response contains manufacturer-specific metadata that may vary by [manufacturer](https://docs.seam.co/latest/device-and-system-integration-guides#access-control-systems).
{% endhint %}

```
AcsCredential(
  acs_credential_id='99999999-9999-9999-9999-999999999999',
  acs_user_id='33333333-3333-3333-3333-333333333333',
  display_name='Multi Phone Sync Credential',
  code=null,
  acs_system_id='11111111-1111-1111-1111-111111111111',
  access_method='mobile_key',
  workspace_id='00000000-0000-0000-0000-000000000000',
  created_at='2024-04-12T03:56:22.396Z',
  is_multi_phone_sync_credential=True,
  # manufacturer-specific metadata
)
```

{% endtab %}

{% tab title="Ruby" %}
**Request:**

```ruby
# Coming soon!
```

**Response:**

```
# Coming soon!
```

{% endtab %}

{% tab title="PHP" %}
**Request:**

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

**Response:**

{% hint style="info" %}
This response contains manufacturer-specific metadata that may vary by [manufacturer](https://docs.seam.co/latest/device-and-system-integration-guides#access-control-systems).
{% endhint %}

```json
{
  "acs_credential_id": "99999999-9999-9999-9999-999999999999",
  "acs_user_id": "33333333-3333-3333-3333-333333333333",
  "display_name": "Multi Phone Sync Credential",
  "code": null,
  "acs_system_id": "11111111-1111-1111-1111-111111111111",
  "access_method": "mobile_key",
  "workspace_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2024-04-12T03:56:22.396Z",
  "is_multi_phone_sync_credential": true,
  // manufacturer-specific metadata
}
```

{% endtab %}

{% tab title="C#" %}
**Request:**

```csharp
seam.CredentialsAcs.Unassign(
  acsUserId: "33333333-3333-3333-3333-333333333333",
  acsCredentialId: "66666666-6666-6666-6666-66666666"
);
```

**Response:**

{% hint style="info" %}
This response contains manufacturer-specific metadata that may vary by [manufacturer](https://docs.seam.co/latest/device-and-system-integration-guides#access-control-systems).
{% endhint %}

```json
{
  "acs_credential_id": "99999999-9999-9999-9999-999999999999",
  "acs_user_id": "33333333-3333-3333-3333-333333333333",
  "display_name": "Multi Phone Sync Credential",
  "code": null,
  "acs_system_id": "11111111-1111-1111-1111-111111111111",
  "access_method": "mobile_key",
  "workspace_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2024-04-12T03:56:22.396Z",
  "is_multi_phone_sync_credential": true,
  // manufacturer-specific metadata
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.seam.co/latest/capability-guides/access-systems/managing-credentials/assigning-credentials-to-users.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
