# Updating users

{% hint style="danger" %}
**`POST /users` requests are limited to a raw JSON payload size of 3 MB.**
{% endhint %}

## Endpoint

<mark style="color:blue;">`POST`</mark> `https://api.signitic.app/users`

## Headers

| Name                                        | Type   | Description  |
| ------------------------------------------- | ------ | ------------ |
| x-api-key<mark style="color:red;">\*</mark> | String | Your API key |

This endpoint supports partial updates. Only the fields included in the payload are updated. The limit applies to the raw request body size, not to a fixed number of users.

## Request body

### Example

```json
{
  "users": [
    {
      "email": "user1@signitic.fr",
      "firstname": "Johanna",
      "postal_code": "75008",
      "city": "Paris"
    },
    {
      "email": "user2@signitic.fr",
      "jobtitle": "Internship",
      "threads_link": "threads.net"
    }
  ]
}
```

### Path dispatch

If `path` is included in the payload, it is resolved from top to bottom: `parent_entity` (or legacy `parent`), then `entity`, then `group`. Empty strings are ignored. Signitic reuses the deepest existing matching branch in the group tree and creates only the missing groups. If no part of the path exists, the full branch is created from the workspace root. The user is then assigned to the lowest group in the resolved path. Groups created this way are blank new groups, not copies of existing ones. Skipping a level is allowed, but not recommended because it makes dispatch harder to understand and debug.

Because dispatch is path-based, different segment combinations can resolve to the same final group.

## Success response

### `200 OK`

```json
{
  "success": true,
  "code": 200,
  "value": {
    "added": 0,
    "edited": 2
  }
}
```

## Error responses

| Status | Internal code | When                                |
| ------ | ------------- | ----------------------------------- |
| 400    | `103`         | The request body is not valid JSON. |
| 401    | `99`          | The API key is missing or invalid.  |
| 422    | `104`         | The raw JSON payload exceeds 3 MB.  |
