Bulk-create invites
/api/v1/identity-invites/bulk-createAuthentication
- Bearer Token
AuthorizationJWT access token
- API Key
X-API-KeyAPI key for management-tier access
Headers
Idempotency-KeyOptional 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
invites *CreateIdentityInviteDto[]
Code samples
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
}
]
}'const response = await fetch("https://api.canopy.dev/api/v1/identity-invites/bulk-create", {
method: "POST",
headers: {
"Idempotency-Key": "value",
"X-API-Key": "$CANOPY_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"invites": [
{
"client_id": "string",
"intent": "activate",
"email": "string",
"first_name": "string",
"last_name": "string",
"role_id": "string",
"node_id": "string",
"send_email": true
}
]
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.canopy.dev/api/v1/identity-invites/bulk-create",
headers={
"Idempotency-Key": "value",
"X-API-Key": "$CANOPY_API_KEY",
"Content-Type": "application/json"
},
json={
"invites": [
{
"client_id": "string",
"intent": "activate",
"email": "string",
"first_name": "string",
"last_name": "string",
"role_id": "string",
"node_id": "string",
"send_email": True,
},
],
},
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload := map[string]interface{}{
"invites": []interface{}{
map[string]interface{}{
"client_id": "string",
"intent": "activate",
"email": "string",
"first_name": "string",
"last_name": "string",
"role_id": "string",
"node_id": "string",
"send_email": true,
},
},
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://api.canopy.dev/api/v1/identity-invites/bulk-create", bytes.NewBuffer(body))
req.Header.Set("Idempotency-Key", "value")
req.Header.Set("X-API-Key", "$CANOPY_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}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
summary *objectresults *object[]
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
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)