# Client API: Mail: Credentials

> The 5 Client API operations for credentials.

Source: https://docs.coritan.com/api/reference/client/mail/mail-credentials/

Part of [Mail](/api/reference/client/mail/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/client/mail/{service_id}/credentials`](#op-get-api-v1-client-mail-service-id-credentials) | List credentials |
| POST | [`/api/v1/client/mail/{service_id}/credentials`](#op-post-api-v1-client-mail-service-id-credentials) | Create credential |
| DELETE | [`/api/v1/client/mail/{service_id}/credentials/{account_id}`](#op-delete-api-v1-client-mail-service-id-credentials-account-id) | Delete credential |
| PATCH | [`/api/v1/client/mail/{service_id}/credentials/{account_id}/enabled`](#op-patch-api-v1-client-mail-service-id-credentials-account-id-enabled) | Credential enabled |
| POST | [`/api/v1/client/mail/{service_id}/credentials/{account_id}/rotate`](#op-post-api-v1-client-mail-service-id-credentials-account-id-rotate) | Rotate credential |

### List credentials {#op-get-api-v1-client-mail-service-id-credentials}

`GET /api/v1/client/mail/{service_id}/credentials`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `service_id` | path | integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Create credential {#op-post-api-v1-client-mail-service-id-credentials}

`POST /api/v1/client/mail/{service_id}/credentials`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `service_id` | path | integer | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `domain_id` | integer | yes |
| `label` | string | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Delete credential {#op-delete-api-v1-client-mail-service-id-credentials-account-id}

`DELETE /api/v1/client/mail/{service_id}/credentials/{account_id}`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `account_id` | path | integer | yes |
| `service_id` | path | integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Credential enabled {#op-patch-api-v1-client-mail-service-id-credentials-account-id-enabled}

`PATCH /api/v1/client/mail/{service_id}/credentials/{account_id}/enabled`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `account_id` | path | integer | yes |
| `service_id` | path | integer | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `enabled` | boolean | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Rotate credential {#op-post-api-v1-client-mail-service-id-credentials-account-id-rotate}

`POST /api/v1/client/mail/{service_id}/credentials/{account_id}/rotate`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `account_id` | path | integer | yes |
| `service_id` | path | integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
