# Invite people

```http
POST https://trydimmi.com/api/v1/invitations
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `members:write`.

## Body

- `invitations` (object[] | null, required): A list of {email, role, custom_role_id, team_ids}. role is admin or member; owners are never invited. team_ids (team_..., 50 at most) are joined on accepting.
  - `custom_role_id` (string): Id of the custom role the person starts with, starting with rol_, such as rol_01jx2m8k4t. Find it with GET /roles. Its base role then takes the place of role.
  - `email` (string, required): The email address the invitation is sent to, such as lee@example.com.
  - `role` (string, required): The role the person joins with: admin or member, such as "member". Owners are never invited. One of: `admin`, `member`.
  - `team_ids` (string[] | null): Ids of the teams the person joins on accepting, as a list of up to 50, such as ["team_01jx2m8k4t"]. Find them with GET /teams.

## Response 200 (OK)

- `data` (object[] | null, required): The items, as a list; empty when there are none.
  - `email` (string, required): The email address as it was given in the batch.
  - `error` (object)
    - `code` (string, required): Short error code saying why this address or row was refused.
    - `message` (string, required): Why this address or row was refused, in words.
  - `invitation` (object, required)
    - `accept_url` (string | null, required): The link the invited person opens to join, to pass on by hand. Set only in the answer that issued or resent the invitation; null otherwise.
    - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
    - `email` (string, required): The email address invited.
    - `expires_at` (string, required): When the invitation stops working.
    - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
    - `invited_by` (object, required)
      - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
      - `name` (string, required): Name of the teammate who sent the invitation.
    - `last_sent_at` (string, required): When the invitation email last went out.
    - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
    - `role` (string, required): The role the person gets on joining: admin or member.
    - `send_count` (integer, required): How many times the invitation has been sent.
    - `status` (string, required): Where the invitation stands: pending, accepted, revoked or expired.
    - `team_ids` (string[] | null, required): Ids of the teams the person joins on accepting, each starting with team_; empty when none.
  - `result` (string, required): What became of this address: created, resent, already_member, reactivation or invalid.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request POST \
  --url 'https://trydimmi.com/api/v1/invitations' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "invitations": [
    {
      "custom_role_id": "<string>",
      "email": "<string>",
      "role": "admin",
      "team_ids": [
        "<string>"
      ]
    }
  ]
}'
```

## Example response

```json
{
  "data": [
    {
      "email": "<string>",
      "error": {
        "code": "<string>",
        "message": "<string>"
      },
      "invitation": {
        "accept_url": "<string>",
        "created_at": "2026-11-01T09:30:00Z",
        "email": "<string>",
        "expires_at": "2026-11-01T09:30:00Z",
        "id": "<string>",
        "invited_by": {
          "id": "<string>",
          "name": "<string>"
        },
        "last_sent_at": "2026-11-01T09:30:00Z",
        "object": "<string>",
        "role": "<string>",
        "send_count": 123,
        "status": "<string>",
        "team_ids": [
          "<string>"
        ]
      },
      "result": "<string>"
    }
  ]
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
