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

Bulk-create Account identities

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

Authentication

  • Bearer Token Authorization

    JWT access token

Request body

  • identitiesCreateAccountIdentityDto[]*

Code samples

cURLJavaScriptPythonGo
curl -X POST "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/identities/bulk-create" \
  -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": {},
        "application_id": "string"
      }
    ]
  }'

Responses

200 Partial-success bulk-create for the Tenant > Identities CSV import wizard. Each row is processed independently; per-row business errors fold into the failures array. Cap of 200 rows per request — the wizard batches the CSV at the same threshold so a single upload becomes N requests. Returns 200 on full success or 207 Multi-Status when any row failed; the body is always `{ summary, results }` so callers iterate the same way regardless. Optional `application_id` per row attaches the identity to that App on creation (creates an AppMembership in the same transaction). — 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",
        "metadata": {},
        "is_active": false,
        "email_verified": false,
        "email_verified_at": "2026-04-20T12:00:00.000Z",
        "locked_until": "2026-04-20T12:00:00.000Z",
        "password_changed_at": "2026-04-20T12:00:00.000Z",
        "app_membership_count": 0,
        "total_assignments": 0,
        "created_at": "2026-04-20T12:00:00.000Z",
        "app_memberships": [
          {
            "id": "string",
            "application_id": "string",
            "application_slug": "string",
            "application_name": "string",
            "status": "active",
            "created_at": "2026-04-20T12:00:00.000Z",
            "assignment_count": 0
          }
        ]
      }
    }
  ]
}

application/json

  • summaryobject*
  • resultsobject[]*
207 Partial-success bulk-create for the Tenant > Identities CSV import wizard. Each row is processed independently; per-row business errors fold into the failures array. Cap of 200 rows per request — the wizard batches the CSV at the same threshold so a single upload becomes N requests. Returns 200 on full success or 207 Multi-Status when any row failed; the body is always `{ summary, results }` so callers iterate the same way regardless. Optional `application_id` per row attaches the identity to that App on creation (creates an AppMembership in the same transaction). — 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",
        "metadata": {},
        "is_active": false,
        "email_verified": false,
        "email_verified_at": "2026-04-20T12:00:00.000Z",
        "locked_until": "2026-04-20T12:00:00.000Z",
        "password_changed_at": "2026-04-20T12:00:00.000Z",
        "app_membership_count": 0,
        "total_assignments": 0,
        "created_at": "2026-04-20T12:00:00.000Z",
        "app_memberships": [
          {
            "id": "string",
            "application_id": "string",
            "application_slug": "string",
            "application_name": "string",
            "status": "active",
            "created_at": "2026-04-20T12:00:00.000Z",
            "assignment_count": 0
          }
        ]
      }
    },
    {
      "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 Account
POSTCreate an Account identity
GETGet directory counts for the Account
GETGet an Account identity
PATCHUpdate an Account identity profile
PATCHSet Account-wide is_active flag
POSTAdmin-trigger a password reset email
POSTRe-send email verification
GETList audit events for an Account identity
POSTAdd an identity to an Application (create AppMembership)
DELETERemove an identity from an Application (revoke AppMembership)