Skip to content
nsin docs

Change a member's role or notifications

PATCH
/domains/{domain}/members/{userId}
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.

domain
required
string

The domain name (for example example.com) — not a numeric id.

Example
example.com
userId
required
integer

The member’s user id, from the member list.

Media type application/json

Partial patch — send only what you want to change. At least one field is required.

object
role

A role that may be assigned to a member or invitation. owner is not grantable — it always follows domain ownership.

string
Allowed values: admin editor viewer
notify

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
key
additional properties
object
key
additional properties
boolean | null

The membership after the change.

Media type application/json

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
id

Membership id.

integer
domain_id
integer
user_id
integer
role

Your role on a domain. owner is implicit for the domain’s creator and for global admins; the other three are grantable via sharing.

string
Allowed values: owner admin editor viewer
notify

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
key
additional properties
object
key
additional properties
boolean
notify_defaulted
object
key
additional properties
Array<string>
Allowed values: email sms
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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
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.)

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

Domain or member not found.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}