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
- 01Grant one team or one member access to a project
- 02Revoke a project grant
- 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
/api/v1/tenancy/projects/{project_id}/grantshttps://api.mahvashai.irapplication/jsonParameters
The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.
| Name | Location | Type | Required | Support | Details |
|---|---|---|---|---|---|
project_id | Path | string | Required | Mahvash extension | Project ID. |
X-Request-ID | Header | string | Optional | Mahvash extension | Client-supplied correlation ID. Echoed on every response; replaced when absent or malformed. |
X-Mahvash-Project | Header | string | Optional | Mahvash extension | Project slug or ID within the caller's organization. Narrows the request principal; it can never widen it. |
membership | Body | string | Optional | Mahvash extension | Membership ID to grant. Exactly one of team or membership. |
role | Body | string | Optional | Mahvash extension | Role the grant confers. Floored by the organization role, never raised above it. |
team | Body | string | Optional | Mahvash extension | Team 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
| HTTP | Details |
|---|---|
| 201 | Grant one team or one member access to a project. |
| 400 | The request is not valid. |
| 401 | Authentication credentials are missing or invalid. |
| 403 | The principal is not allowed to perform this request. |
| 404 | No such resource is visible to this principal. |
| 429 | A quota or rate limit was exceeded. |
| 500 | An internal error occurred. |
Revoke a project grant
/api/v1/tenancy/projects/{project_id}/grants/{grant_id}https://api.mahvashai.irParameters
The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.
| Name | Location | Type | Required | Support | Details |
|---|---|---|---|---|---|
project_id | Path | string | Required | Mahvash extension | Project ID. |
grant_id | Path | string | Required | Mahvash extension | Grant ID. |
X-Request-ID | Header | string | Optional | Mahvash extension | Client-supplied correlation ID. Echoed on every response; replaced when absent or malformed. |
X-Mahvash-Project | Header | string | Optional | Mahvash extension | Project 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
| HTTP | Details |
|---|---|
| 200 | Revoke a project grant. |
| 400 | The request is not valid. |
| 401 | Authentication credentials are missing or invalid. |
| 403 | The principal is not allowed to perform this request. |
| 404 | No such resource is visible to this principal. |
| 429 | A quota or rate limit was exceeded. |
| 500 | An internal error occurred. |
List the teams and members granted access to a project
/api/v1/tenancy/projects/{project_id}/grantshttps://api.mahvashai.irParameters
The table shows the accepted inputs for this endpoint. Examples use placeholders and illustrate a safe integration pattern.
| Name | Location | Type | Required | Support | Details |
|---|---|---|---|---|---|
project_id | Path | string | Required | Mahvash extension | Project ID. |
X-Request-ID | Header | string | Optional | Mahvash extension | Client-supplied correlation ID. Echoed on every response; replaced when absent or malformed. |
X-Mahvash-Project | Header | string | Optional | Mahvash extension | Project 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
| HTTP | Details |
|---|---|
| 200 | List the teams and members granted access to a project. |
| 401 | Authentication credentials are missing or invalid. |
| 403 | The principal is not allowed to perform this request. |
| 404 | No such resource is visible to this principal. |
| 429 | A quota or rate limit was exceeded. |
| 500 | An internal error occurred. |