Skip to main content
POST
/
v2
/
organizations
/
{organizationId}
/
directories
/
{directoryId}
/
grants
curl -X POST "https://api.orbitsearch.com/v2/organizations/$ORGANIZATION_ID/directories/$DIRECTORY_ID/grants" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "principal_type": "api_key",
    "principal_id": "API_KEY_UUID",
    "permission": "search"
  }'
Assigns a permission to a principal on the specified directory. If the principal already has a grant on this directory, the existing grant is updated. See directory access grants for the permission model.

Path parameters

organizationId
string
required
The UUID of the owning organization.
directoryId
string
required
The UUID of the directory to grant access on.

Request body

principal_type
string
required
The type of principal receiving the grant. One of organization, user, or api_key.
principal_id
string
required
The UUID of the principal — the organization ID, user ID, or API key ID depending on principal_type.
permission
string
required
The permission to assign. One of search, upload, or manage.
curl -X POST "https://api.orbitsearch.com/v2/organizations/$ORGANIZATION_ID/directories/$DIRECTORY_ID/grants" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "principal_type": "api_key",
    "principal_id": "API_KEY_UUID",
    "permission": "search"
  }'