# Create a user

`POST https://api.cademi.com.br/api/v3/users`

Operation ID: `users.create` · API v3

Creates a user. Tags and custom field values supplied in the request are applied to the new user.

The `Location` header of the response contains the URL of the new user.

If another user in the account already has the same email address or `external_id`, the API returns `already_exists`. If the account has reached the user limit of its plan, the API returns `plan_limit_reached`.

Required permissions: `users.create`.

## Request body

Content type: `application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `custom_fields` | object | no |  |
| `document` | string or null | no |  |
| `email` | string (email) | yes |  |
| `external_id` | string or null | no |  |
| `name` | string | yes |  |
| `phone` | string or null | no |  |
| `send_credentials` | boolean | no |  |
| `tags` | array of string | no |  |

## Responses

### 201

Returns the newly created user.

Body: `data`: User.

Fields of User:

| Field | Type | Required | Description |
|---|---|---|---|
| `access` | string, one of `granted`, `none` | yes |  |
| `created_at` | string (date-time) | yes |  |
| `deleted` | boolean | yes |  |
| `document` | string or null | no |  |
| `email` | string (email) | yes |  |
| `external_id` | string or null | no |  |
| `id` | string | yes |  |
| `name` | string | yes |  |
| `object` | string, one of `user` | yes |  |
| `phone` | string or null | no |  |
| `revision` | string | yes |  |
| `status` | string, one of `active`, `inactive` | yes |  |
| `tags` | array of string | yes |  |
| `updated_at` | string (date-time) | yes |  |

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 409

A user with the same email address or external_id already exists, or the account has reached the user limit of its plan.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

Full schema: https://cademi.dev/openapi/v3.json
