ServicesAuthorizationHTTP APIRole grants

Grant_role

POST
/api/authorization/projects/{project_id}/grants

Grant a Project role with project grant role permission.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Path Parameters

project_id*string

Request Body

application/json
  1. body

A Project role and the principal receiving it.

principal*||

The identity or membership role that receives a Project role.

role*authorization.Role

Project authorization role.

Value in"admin""editor""viewer"

Response Body

Success

application/json
  1. response

The created Project role grant.

grant*

A role granted to a principal in one Project.

curl -X POST 'https://api.spiraldb.dev/api/authorization/projects/string/grants' \  -H 'Content-Type: application/json' \  -d '{  "principal": {    "organizationRole": {      "organizationId": "string",      "role": "string"    },    "type": "organizationRole"  },  "role": "admin"}'
{  "grant": {    "conditions": {      "property1": "string",      "property2": "string"    },    "id": "string",    "principal": "string",    "projectId": "string",    "role": "admin"  }}