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

Bulk-create identities

POST/portal/v1/accounts/{accountSlug}/applications/{appSlug}/identities/bulk-create

Authentication

  • Bearer Token Authorization

    JWT access token

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

  • identitiesCreateIdentityDto[]*

Code samples

cURLJavaScriptPythonGo
curl -X POST "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/identities/bulk-create" \
  -H "Idempotency-Key: value" \
  -H "Authorization: Bearer $CANOPY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "identities": [
      {
        "email": "string",
        "first_name": "string",
        "last_name": "string",
        "password": "string",
        "external_id": "string",
        "metadata": {},
        "role_id": "string",
        "node_id": "string"
      }
    ]
  }'

Responses

200 Per-row identity creation. Each row is processed independently — duplicates and validation errors 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",
        "first_name": "string",
        "last_name": "string",
        "avatar_url": "string",
        "external_id": "string",
        "is_active": false,
        "created_at": "2026-04-20T12:00:00.000Z"
      }
    }
  ]
}

application/json

  • summaryobject*
  • resultsobject[]*
207 Per-row identity creation. Each row is processed independently — duplicates and validation errors 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",
        "first_name": "string",
        "last_name": "string",
        "avatar_url": "string",
        "external_id": "string",
        "is_active": false,
        "created_at": "2026-04-20T12:00:00.000Z"
      }
    },
    {
      "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 identities in Application
POSTCreate an identity
GETList identities with their role assignments
GETGet Application identities summary
POSTRecord a bulk-import wizard completion
GETGet an identity
PATCHUpdate an identity
DELETERemove an identity
GETGet identity detail with role assignments
POSTActivate an identity
POSTDeactivate an identity
GETGet identity's role assignments
GETGet identity's effective permissions