Skip to main content
POST

Overview

Batch creation allows you to create multiple scopes in a single API call. You can provide client IDs for in-batch references, set up parent relationships, and add memberships with role assignments.
ID Format: All IDs use a namespaced UUIDv7 format: scope_{uuidv7}. You can optionally provide your own IDs for in-batch references.

Request Body

Array of scope objects:
string
Optional client-provided ID. Useful for referencing within the same batch.
string
required
ID of the scope type
string
Display name for the scope
string
External identifier for the scope
object
Optional metadata to associate with the scope
string
Optional parent scope ID. Automatically creates a scope hierarchy edge.
array
Optional array of inline memberships. Each membership has:
  • subjectId (required): The subject to add to this scope
  • roleIds (optional): Array of role IDs to assign

Response

Returns an array of created scope objects.
Each scope can include parentScopeId and memberships to set up the complete structure in one request.

Examples

Basic Batch

With In-Batch Parent References

Use client-provided IDs to reference scopes within the same batch: