API reference
Organization members
Membership gives a user access to an organization. Role and project policy still determine which management actions are permitted.
How it fits together
- 01Change one member's organization role or default team
- 02Remove or suspend a member, revoking every team row and grant they held
- 03List members of the selected organization
Select an action to see its complete inputs, request, response, and status codes.
Change one member's organization role or default team
/api/v1/tenancy/members/{membership_id}https://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 |
|---|---|---|---|---|---|
membership_id | Path | string | Required | Mahvash extension | Membership 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. |
default_team | Body | string | Optional | Mahvash extension | Team this member's work is charged to when nothing else says. Must be a team they belong to; null clears it. Attribution only - it confers no access. |
role | Body | string | Optional | Mahvash extension | Organization role: owner, admin, member, or viewer. Never above the caller's own. |
Request
curl -X PATCH 'https://api.mahvashai.ir/api/v1/tenancy/members/<membership_id>' \
-H "Authorization: Bearer $MAHVASH_USER_JWT" \
-H "Content-Type: application/json" \
-d '{
"default_team": "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 |
|---|---|
| 200 | Change one member's organization role or default team. |
| 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. |
Remove or suspend a member, revoking every team row and grant they held
/api/v1/tenancy/members/{membership_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 |
|---|---|---|---|---|---|
membership_id | Path | string | Required | Mahvash extension | Membership 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/members/<membership_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 | Remove or suspend a member, revoking every team row and grant they held. |
| 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 members of the selected organization
/api/v1/tenancy/membershttps://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 |
|---|---|---|---|---|---|
page | Query | integer | Optional | Mahvash extension | Bounded tenancy-list page query parameter. |
page_size | Query | integer | Optional | Mahvash extension | Bounded tenancy-list page_size query parameter. |
role | Query | string | Optional | Mahvash extension | Bounded tenancy-list role query parameter. |
search | Query | string | Optional | Mahvash extension | Bounded tenancy-list search query parameter. |
status | Query | string | Optional | Mahvash extension | Bounded tenancy-list status query parameter. |
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/members' \
-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 members of the selected organization. |
| 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. |