1. Docs
  2. API Reference
  3. Bulk-create invites

Bulk-create invites

POST/api/v1/identity-invites/bulk-create

Authentication

  • Bearer Token Authorization

    JWT access token

  • API Key X-API-Key

    API key for management-tier access

Headers

  • Idempotency-Key

    Optional opaque string the server uses to deduplicate retried requests. When the same key is replayed within 24 hours, the original response (status + body) is returned without re-processing — eliminates duplicate writes from network blips between server commit and client receipt. Generate one per logical operation (UUIDv4 recommended). Max 255 characters.

Request body

  • invitesCreateIdentityInviteDto[]*

Code samples

cURLJavaScriptPythonGo
curl -X POST "https://api.canopy.dev/api/v1/identity-invites/bulk-create" \
  -H "Idempotency-Key: value" \
  -H "X-API-Key: $CANOPY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "invites": [
      {
        "client_id": "string",
        "intent": "activate",
        "email": "string",
        "first_name": "string",
        "last_name": "string",
        "role_id": "string",
        "node_id": "string",
        "send_email": true
      }
    ]
  }'

Responses

200 Per-row invite creation. Each row is processed independently — duplicates, validation errors, and OAuth-client misconfiguration fail individually without aborting the batch. Returns 200 on full success or 207 Multi-Status on mixed outcomes; the body is always { summary, results } so callers iterate the same way regardless. — all items succeeded
{
  "summary": {
    "total": 0,
    "succeeded": 0,
    "failed": 0
  },
  "results": [
    {
      "index": 0,
      "status": "success",
      "code": 0,
      "data": {
        "id": "string",
        "email": "string",
        "intent": "activate",
        "first_name": "string",
        "last_name": "string",
        "name": "string",
        "role_id": "string",
        "node_id": "string",
        "has_initial_assignment": false,
        "status": "pending",
        "expires_at": "2026-04-20T12:00:00.000Z",
        "invited_by": "string",
        "created_at": "2026-04-20T12:00:00.000Z",
        "accept_url": "string"
      }
    }
  ]
}

application/json

  • summaryobject*
  • resultsobject[]*
207 Per-row invite creation. Each row is processed independently — duplicates, validation errors, and OAuth-client misconfiguration fail individually without aborting the batch. Returns 200 on full success or 207 Multi-Status on mixed outcomes; the body is always { summary, results } so callers iterate the same way regardless. — mixed outcomes (one or more items failed)
{
  "summary": {
    "total": 0,
    "succeeded": 0,
    "failed": 0
  },
  "results": [
    {
      "index": 0,
      "status": "success",
      "code": 0,
      "data": {
        "id": "string",
        "email": "string",
        "intent": "activate",
        "first_name": "string",
        "last_name": "string",
        "name": "string",
        "role_id": "string",
        "node_id": "string",
        "has_initial_assignment": false,
        "status": "pending",
        "expires_at": "2026-04-20T12:00:00.000Z",
        "invited_by": "string",
        "created_at": "2026-04-20T12:00:00.000Z",
        "accept_url": "string"
      }
    },
    {
      "index": 0,
      "status": "error",
      "code": 0,
      "input": {},
      "error": {
        "code": "string",
        "message": "string",
        "details": {}
      }
    }
  ]
}

application/json

  • summaryobject*
  • results("success" | "error")[]*
401 Invalid or expired token
403 This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)
On this page

Related endpoints

GETList invites
POSTCreate an invite
GETGet invite summary
POSTResend an invite
DELETERevoke an invite