Skip to content

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

  1. 01Change one member's organization role or default team
  2. 02Remove or suspend a member, revoking every team row and grant they held
  3. 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

PATCH/api/v1/tenancy/members/{membership_id}
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
membership_idPathstringRequiredMahvash extensionMembership 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.
default_teamBodystringOptionalMahvash extensionTeam 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.
roleBodystringOptionalMahvash extensionOrganization 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

HTTPDetails
200Change one member's organization role or default team.
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.

Remove or suspend a member, revoking every team row and grant they held

DELETE/api/v1/tenancy/members/{membership_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
membership_idPathstringRequiredMahvash extensionMembership 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/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

HTTPDetails
200Remove or suspend a member, revoking every team row and grant they held.
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 members of the selected organization

GET/api/v1/tenancy/members
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
pageQueryintegerOptionalMahvash extensionBounded tenancy-list page query parameter.
page_sizeQueryintegerOptionalMahvash extensionBounded tenancy-list page_size query parameter.
roleQuerystringOptionalMahvash extensionBounded tenancy-list role query parameter.
searchQuerystringOptionalMahvash extensionBounded tenancy-list search query parameter.
statusQuerystringOptionalMahvash extensionBounded tenancy-list status query parameter.
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/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

HTTPDetails
200List members of the selected organization.
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.