Invite a user

Sends an invitation to a user to join the organization or profile with a specific role. Requires admin role. The user will receive an invitation email with a token to accept. Invitation tokens expire after 7 days.

POST
/v3/users

Header Parameters

Idempotency-Key?string

Unique key to ensure idempotent request processing. Must be 1-255 alphanumeric characters, hyphens, or underscores. Responses are cached for 24 hours per key per customer.

Match^[a-zA-Z0-9_-]+$
Lengthlength <= 255
x-profile-id?string

Profile UUID to scope the request to a child profile. Only organization API keys can use this header. The profile must belong to the calling organization.

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.sent.dm/v3/users" \  -H "Idempotency-Key: req_abc123_retry1" \  -H "Content-Type: application/json" \  -d '{    "email": "newuser@example.com",    "name": "New User",    "role": "developer",    "sandbox": false  }'
{
  "success": true,
  "data": {
    "id": "aa0e8400-e29b-41d4-a716-446655440005",
    "email": "newuser@example.com",
    "name": "New User",
    "role": "developer",
    "status": "invited",
    "invited_at": "2026-03-11T21:50:49.7797043+00:00",
    "last_login_at": null,
    "created_at": "2026-03-11T21:50:49.7797046+00:00",
    "updated_at": "2026-03-11T21:50:49.7797047+00:00"
  },
  "error": null,
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-03-11T21:50:49.779705+00:00",
    "version": "v3"
  }
}
{
  "success": false,
  "data": null,
  "error": {
    "code": "VALIDATION_001",
    "message": "Request validation failed",
    "details": {
      "email": [
        "Email must be a valid email address"
      ],
      "role": [
        "Role must be one of: admin, billing, developer"
      ]
    },
    "doc_url": "https://docs.sent.dm/errors/VALIDATION_001"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-03-11T21:50:49.7797939+00:00",
    "version": "v3"
  }
}
Empty
{
  "success": false,
  "data": null,
  "error": {
    "code": "AUTH_004",
    "message": "You do not have admin access to this organization or profile",
    "details": null,
    "doc_url": "https://docs.sent.dm/errors/AUTH_004"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-03-11T21:50:49.7797948+00:00",
    "version": "v3"
  }
}
{
  "success": false,
  "data": null,
  "error": {
    "code": "RESOURCE_005",
    "message": "Organization not found",
    "details": null,
    "doc_url": "https://docs.sent.dm/errors/RESOURCE_005"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-03-11T21:50:49.7797953+00:00",
    "version": "v3"
  }
}
{
  "success": false,
  "data": null,
  "error": {
    "code": "RESOURCE_007",
    "message": "User already exists in this organization",
    "details": null,
    "doc_url": "https://docs.sent.dm/errors/RESOURCE_007"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-03-11T21:50:49.7797977+00:00",
    "version": "v3"
  }
}
{
  "success": false,
  "data": null,
  "error": {
    "code": "INTERNAL_001",
    "message": "An unexpected error occurred. Please contact support with request ID: req_7X9zKp2jDw",
    "details": null,
    "doc_url": "https://docs.sent.dm/errors/INTERNAL_001"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-03-11T21:50:49.7797982+00:00",
    "version": "v3"
  }
}