PATCH /members/{userId}
Updated Oct 1, 20261 minute read
Change somebody's role
Promotes or demotes somebody. Making an owner hands the organization over. The ranking rules are checked against your own role: an admin cannot touch another admin, only an owner can make one, and the last owner cannot step down.
Part of Organization.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
userId | path | string | Yes |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
role | "owner" | "admin" | "member" | Yes |
Responses
| Status | Description |
|---|---|
200 | Done. |
400 | The request is malformed, and the message names the field. |
401 | The bearer token is missing, revoked, or expired. |
403 | The token's person does not hold the role this needs. |
404 | Not one of yours, or not there at all. |
429 | Too many requests. Wait the seconds in Retry-After. Limits depend on the plan. See rate limits. |
200 body
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | No |
Example response
{
"ok": true
}Example request
curl -X PATCH https://api.median.sh/v1/members/userId \
-H "Authorization: Bearer $BEARER_AUTH"