Batch import users — server token only
const url = 'http://localhost:3000/v1/batch/users';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"users":[{"id":"example","custom":{}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/v1/batch/users \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "users": [ { "id": "example", "custom": {} } ] }'Cold-start import: upsert up to 100 users in one call. Quiet — no side effects exist for users, but the batch family as a whole fires no notifications, live-mode head bumps, or webhooks. Idempotent: items use the existing upsert semantics, so rerunning a batch is safe. Partial failure still returns 200 — inspect per-item results.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
Examplegenerated
{ "users": [ { "id": "example", "custom": {} } ]}Responses
Section titled “Responses”Envelope accepted. Per-item results, ordered and same-length as the input; a failed item never rolls back the rest.
object
object
Present when ok for users/activities
§8 error code, present when not ok
Examplegenerated
{ "results": [ { "index": 1, "ok": true, "id": "example", "code": "example" } ]}Envelope invalid (0 items, more than 100 items, or malformed shape).
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}User tokens cannot import — batch routes are server token only.
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}Batch rate limit exceeded. Batch routes charge a separate 600 requests/min window per tenant — never the normal tenant limit.
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}