Edit a user
Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.
Changes the label, name or stored contact. Send only the fields to change. Changing the contact cancels a pending login invite.
Once the person has taken over their login (accepted an invite, or
has an email, phone or password of their own), their name and contact
are theirs: only label can still be changed.
Path parameters
- idintegerrequiredpath
The id of one of your users.
Request body
Content type: application/json · required
- labelstring
Your own name for the account. Only you see it.
- namestring
The person's name.
- contact_emailstring (email)
Where a login invite can go. Not the account's login until accepted.
- contact_phonestring
Where an SMS invite can go (Iranian mobile).
Responses
200The updated user.
Content type: application/json
- idinteger
- labelstring
- namestring | null
- contact_emailstring
- contact_phonestring
- invited_atstring | null (date-time)
When the last login invite was sent.
- login_acceptedboolean
The person accepted an invite and has their own login.
- billing_modestringOne of:
"reseller""self" - balance_rialsinteger (int64)
The user's own wallet.
- domainsinteger
- suspended_domainsinteger
Domains you suspended.
- created_atstring (date-time)
{
"id": 0,
"label": "string",
"name": "string",
"contact_email": "string",
"contact_phone": "string",
"invited_at": "2026-01-01T00:00:00Z",
"login_accepted": true,
"billing_mode": "reseller",
"balance_rials": 0,
"domains": 0,
"suspended_domains": 0,
"created_at": "2026-01-01T00:00:00Z"
}400A field is too long or not a valid email or phone.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}401Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "invalid API key"
}403The key is read-only and this endpoint is a write. Read-only keys may
only issue GET, HEAD and OPTIONS.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}404No user with this id among yours.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "user not found"
}409The person has taken over their login; their name and contact can't be changed.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}Example request
curl -X PATCH "https://api.nsin.ir/reseller/v1/users/0" \
-H "Authorization: Bearer $NSIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "string",
"name": "string",
"contact_email": "string",
"contact_phone": "string"
}'