Skip to content

API reference

Project access grants

Grants connect users or teams to a restricted project when that deployment capability is enabled. Check availability before building a grant flow.

How it fits together

  1. 01Grant one team or one member access to a project
  2. 02Revoke a project grant
  3. 03List the teams and members granted access to a project

Select an action to see its complete inputs, request, response, and status codes.

Grant one team or one member access to a project

POST/api/v1/tenancy/projects/{project_id}/grants
Production base URLhttps://api.mahvashai.ir
AuthenticationUser access JWT
ResponseMahvash product envelope
Content typeapplication/json

Parameters

The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.

NameLocationTypeRequiredSupportDetails
project_idPathstringRequiredMahvash extensionProject ID.
X-Request-IDHeaderstringOptionalMahvash extensionClient-supplied correlation ID. Echoed on every response; replaced when absent or malformed.
X-Mahvash-ProjectHeaderstringOptionalMahvash extensionProject slug or ID within the caller's organization. Narrows the request principal; it can never widen it.
membershipBodystringOptionalMahvash extensionMembership ID to grant. Exactly one of team or membership.
roleBodystringOptionalMahvash extensionRole the grant confers. Floored by the organization role, never raised above it.
teamBodystringOptionalMahvash extensionTeam ID to grant. Exactly one of team or membership.

Request

curl -X POST 'https://api.mahvashai.ir/api/v1/tenancy/projects/<project_id>/grants' \
  -H "Authorization: Bearer $MAHVASH_USER_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "membership": "8f14e45f-ceea-467a-9d4a-1f2b3c4d5e6f"
}'

Response

{
  "status": 0,
  "data": "<value>"
}

Illustrative response shape; actual fields depend on the operation and model.

Status codes

HTTPDetails
201Grant one team or one member access to a project.
400The request is not valid.
401Authentication credentials are missing or invalid.
403The principal is not allowed to perform this request.
404No such resource is visible to this principal.
429A quota or rate limit was exceeded.
500An internal error occurred.

Revoke a project grant

DELETE/api/v1/tenancy/projects/{project_id}/grants/{grant_id}
Production base URLhttps://api.mahvashai.ir
AuthenticationUser access JWT
ResponseMahvash product envelope

Parameters

The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.

NameLocationTypeRequiredSupportDetails
project_idPathstringRequiredMahvash extensionProject ID.
grant_idPathstringRequiredMahvash extensionGrant ID.
X-Request-IDHeaderstringOptionalMahvash extensionClient-supplied correlation ID. Echoed on every response; replaced when absent or malformed.
X-Mahvash-ProjectHeaderstringOptionalMahvash extensionProject slug or ID within the caller's organization. Narrows the request principal; it can never widen it.

Request

curl -X DELETE 'https://api.mahvashai.ir/api/v1/tenancy/projects/<project_id>/grants/<grant_id>' \
  -H "Authorization: Bearer $MAHVASH_USER_JWT"

Response

{
  "status": 0,
  "data": "<value>"
}

Illustrative response shape; actual fields depend on the operation and model.

Status codes

HTTPDetails
200Revoke a project grant.
400The request is not valid.
401Authentication credentials are missing or invalid.
403The principal is not allowed to perform this request.
404No such resource is visible to this principal.
429A quota or rate limit was exceeded.
500An internal error occurred.

List the teams and members granted access to a project

GET/api/v1/tenancy/projects/{project_id}/grants
Production base URLhttps://api.mahvashai.ir
AuthenticationUser access JWT
ResponseMahvash product envelope

Parameters

The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.

NameLocationTypeRequiredSupportDetails
project_idPathstringRequiredMahvash extensionProject ID.
X-Request-IDHeaderstringOptionalMahvash extensionClient-supplied correlation ID. Echoed on every response; replaced when absent or malformed.
X-Mahvash-ProjectHeaderstringOptionalMahvash extensionProject slug or ID within the caller's organization. Narrows the request principal; it can never widen it.

Request

curl -X GET 'https://api.mahvashai.ir/api/v1/tenancy/projects/<project_id>/grants' \
  -H "Authorization: Bearer $MAHVASH_USER_JWT"

Response

{
  "status": 0,
  "data": "<value>"
}

Illustrative response shape; actual fields depend on the operation and model.

Status codes

HTTPDetails
200List the teams and members granted access to a project.
401Authentication credentials are missing or invalid.
403The principal is not allowed to perform this request.
404No such resource is visible to this principal.
429A quota or rate limit was exceeded.
500An internal error occurred.