Change a member's role or notifications
const url = 'https://api.nsin.ir/domains/example.com/members/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role":"admin","notify":{"additionalProperty":{"additionalProperty":true}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.nsin.ir/domains/example.com/members/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "role": "admin", "notify": { "additionalProperty": { "additionalProperty": true } } }'Partial update. Changing role requires members.manage; a member may
change their own notification preferences without it.
The owner’s role cannot be changed, and the owner always receives every notification category.
A role change freezes whatever the OLD role was switching on, so a demotion cannot silently mute alerts the member was already receiving. Categories they never touched still follow the new role.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The domain name (for example example.com) — not a numeric id.
Example
example.comThe member’s user id, from the member list.
Request Body required
Section titled “Request Body required ”Partial patch — send only what you want to change. At least one field is required.
object
A role that may be assigned to a member or invitation. owner is not
grantable — it always follows domain ownership.
Category → channel → tri-state. true/false records an explicit
choice; null deletes the stored choice so the pair falls back
to the member’s role default — that is how you reset a switch rather
than pinning it off. Unknown categories or channels are rejected, so
a typo can never read as “no change made”.
object
object
Responses
Section titled “ Responses ”The membership after the change.
The membership after a patch. Narrower than Member — it carries the
membership itself and the recomputed notification matrix, not the user
profile you already have from the member list.
object
Membership id.
Your role on a domain. owner is implicit for the domain’s creator and
for global admins; the other three are grantable via sharing.
Category → channel → enabled. The effective matrix: explicit choices merged over the member’s role defaults, so a client never has to reimplement the fallback.
object
object
object
Example
{ "role": "owner", "notify_defaulted": { "additionalProperty": [ "email" ] }}Invalid user id or body, nothing to update, an invalid role, or an attempt to change the owner’s role or notifications.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}The key is read-only, your role on the domain lacks the required permission, or the domain’s plan does not include the feature.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}Domain or member not found.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}