curl -X POST 'https://api.example.com/scopes' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Engineering Team",
"typeId": "type_team",
"externalId": "team-eng",
"parentScopeId": "scope_org",
"memberships": [
{"subjectId": "subject_jane", "roleIds": ["role_admin"]},
{"subjectId": "subject_bob", "roleIds": ["role_member"]}
]
}'
{
"id": "scope_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
"name": "Engineering Team",
"typeId": "type_team",
"externalId": "team-eng"
}
Create a new scope with optional inline memberships
curl -X POST 'https://api.example.com/scopes' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Engineering Team",
"typeId": "type_team",
"externalId": "team-eng",
"parentScopeId": "scope_org",
"memberships": [
{"subjectId": "subject_jane", "roleIds": ["role_admin"]},
{"subjectId": "subject_bob", "roleIds": ["role_member"]}
]
}'
{
"id": "scope_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
"name": "Engineering Team",
"typeId": "type_team",
"externalId": "team-eng"
}
scope_{uuidv7}subjectId (required): The subject to add to this scoperoleIds (optional): Array of role IDs to assign to the membershipparentScopeId and memberships.curl -X POST 'https://api.example.com/scopes' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Engineering Team",
"typeId": "type_team",
"externalId": "team-eng",
"parentScopeId": "scope_org",
"memberships": [
{"subjectId": "subject_jane", "roleIds": ["role_admin"]},
{"subjectId": "subject_bob", "roleIds": ["role_member"]}
]
}'
{
"id": "scope_0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
"name": "Engineering Team",
"typeId": "type_team",
"externalId": "team-eng"
}
curl -X POST 'https://api.example.com/scopes' \
-d '{
"name": "Engineering",
"typeId": "type_department"
}'
curl -X POST 'https://api.example.com/scopes' \
-d '{
"name": "Backend Team",
"typeId": "type_team",
"parentScopeId": "scope_engineering"
}'
curl -X POST 'https://api.example.com/scopes' \
-d '{
"name": "Project Alpha",
"typeId": "type_project",
"parentScopeId": "scope_team",
"memberships": [
{"subjectId": "subject_jane", "roleIds": ["role_admin", "role_developer"]},
{"subjectId": "subject_bob", "roleIds": ["role_developer"]},
{"subjectId": "subject_agent", "roleIds": ["role_viewer"]}
]
}'
Was this page helpful?