Bulk-create Account identities
/portal/v1/accounts/{accountSlug}/identities/bulk-createAuthentication
- Bearer Token
AuthorizationJWT access token
Request body
identities *CreateAccountIdentityDto[]
Code samples
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"
}
]
}'const response = await fetch("https://api.canopy.dev/portal/v1/accounts/{accountSlug}/identities/bulk-create", {
method: "POST",
headers: {
"Authorization": "Bearer $CANOPY_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"identities": [
{
"email": "string",
"first_name": "string",
"last_name": "string",
"password": "string",
"external_id": "string",
"metadata": {},
"application_id": "string"
}
]
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.canopy.dev/portal/v1/accounts/{accountSlug}/identities/bulk-create",
headers={
"Authorization": "Bearer $CANOPY_TOKEN",
"Content-Type": "application/json"
},
json={
"identities": [
{
"email": "string",
"first_name": "string",
"last_name": "string",
"password": "string",
"external_id": "string",
"metadata": {},
"application_id": "string",
},
],
},
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload := map[string]interface{}{
"identities": []interface{}{
map[string]interface{}{
"email": "string",
"first_name": "string",
"last_name": "string",
"password": "string",
"external_id": "string",
"metadata": map[string]interface{}{},
"application_id": "string",
},
},
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/identities/bulk-create", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer $CANOPY_TOKEN")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}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
summary *objectresults *object[]
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
summary *objectresults *("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)