Modify a user
Updates a user’s profile information along with their roles and permissions. Only the supplied properties are changed. The user can be referenced by identifier or email address.
Changing roles or permissions requires additional access. Updating only
the profile properties requires none beyond authentication.
Permissions
| Resource | Permission | Usage |
|---|---|---|
user | manage | Required only when roles or permissions are supplied |
curl --request PATCH \
--url https://api.mezmo.com/v3/auth/user/{user_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"firstname": "John",
"lastname": "Doe",
"roles": [
"<string>"
],
"permissions": {
"view": {
"read": true,
"write": true,
"manage": false
}
}
}
'import requests
url = "https://api.mezmo.com/v3/auth/user/{user_id}"
payload = {
"firstname": "John",
"lastname": "Doe",
"roles": ["<string>"],
"permissions": { "view": {
"read": True,
"write": True,
"manage": False
} }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstname: 'John',
lastname: 'Doe',
roles: ['<string>'],
permissions: {view: {read: true, write: true, manage: false}}
})
};
fetch('https://api.mezmo.com/v3/auth/user/{user_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mezmo.com/v3/auth/user/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'firstname' => 'John',
'lastname' => 'Doe',
'roles' => [
'<string>'
],
'permissions' => [
'view' => [
'read' => true,
'write' => true,
'manage' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mezmo.com/v3/auth/user/{user_id}"
payload := strings.NewReader("{\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"roles\": [\n \"<string>\"\n ],\n \"permissions\": {\n \"view\": {\n \"read\": true,\n \"write\": true,\n \"manage\": false\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.mezmo.com/v3/auth/user/{user_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"roles\": [\n \"<string>\"\n ],\n \"permissions\": {\n \"view\": {\n \"read\": true,\n \"write\": true,\n \"manage\": false\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mezmo.com/v3/auth/user/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"roles\": [\n \"<string>\"\n ],\n \"permissions\": {\n \"view\": {\n \"read\": true,\n \"write\": true,\n \"manage\": false\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"type": "<string>",
"page": {
"next": "<string>",
"previous": "<string>"
},
"pk": "<string>",
"links": {
"self": {
"list": {
"method": "get",
"uri": "https://api.mezmo.com/v3/auth/resource"
},
"detail": {
"method": "get",
"uri": "https://api.mezmo.com/v3/auth/resource/{resource_id}"
},
"update": {
"method": "patch",
"uri": "https://api.mezmo.com/v3/auth/resource/{resource_id}"
},
"replace": {
"method": "put",
"uri": "https://api.mezmo.com/v3/auth/resource/{resource_id}"
},
"create": {
"method": "post",
"uri": "https://api.mezmo.com/v3/auth/resource"
}
},
"related": {}
}
},
"data": {
"user_id": "5b7ca8b2b59ba49d58cc79ac",
"firstname": "John",
"lastname": "Doe",
"email": "member@snippetfactory.com",
"name": "John Doe",
"accounts": [
"25ef43eae1",
"b7bebbcd13"
],
"enterprise_ids": [
"25ef43eae1",
"b7bebbcd13"
],
"verified": true,
"isbanned": true,
"bandetails": {
"bannedat": "2026-01-15T12:00:00.000Z",
"banreason": "Unprofessional Conduct",
"bannedby": {
"name": "Jand Doe",
"email": "admin@snippetfactory.com"
}
},
"roles": [
"5b7ca8b2b59ba49d58cc79ac",
"5b8fa85cb59ba49d588942b3"
],
"permissions": {
"view": {
"read": true,
"write": true,
"manage": false
}
}
}
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}Authorizations
The primary authentication method for the Mezmo API.
Pass the key in the Authorization header in the format Token <ACCESS TOKEN>.
For example:
curl -H 'Authorization: Token <ACCESS TOKEN>'
This key is used for all APIs with the exception of ingest.
Path Parameters
The email or ID of the user to update
2 - 128Body
Represents an individual human and is used in registration, authentication and authorization.
Represents an individual human and is used in registration, authentication and authorization.
Name of user given to them upon birth.
50"John"
Common family or surname of the user.
50"Doe"
A list of role identifiers or role names to assign to the user
502 - 128Permissions represent the set of resources a particular entity has access to.
Show child attributes
Show child attributes
{
"view": {
"read": true,
"write": true,
"manage": false
}
}
Response
Response format containing the updated user in addition to the standard metadata object.
Response format containing the updated user in addition to the standard metadata object.
Was this page helpful?
curl --request PATCH \
--url https://api.mezmo.com/v3/auth/user/{user_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"firstname": "John",
"lastname": "Doe",
"roles": [
"<string>"
],
"permissions": {
"view": {
"read": true,
"write": true,
"manage": false
}
}
}
'import requests
url = "https://api.mezmo.com/v3/auth/user/{user_id}"
payload = {
"firstname": "John",
"lastname": "Doe",
"roles": ["<string>"],
"permissions": { "view": {
"read": True,
"write": True,
"manage": False
} }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstname: 'John',
lastname: 'Doe',
roles: ['<string>'],
permissions: {view: {read: true, write: true, manage: false}}
})
};
fetch('https://api.mezmo.com/v3/auth/user/{user_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mezmo.com/v3/auth/user/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'firstname' => 'John',
'lastname' => 'Doe',
'roles' => [
'<string>'
],
'permissions' => [
'view' => [
'read' => true,
'write' => true,
'manage' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mezmo.com/v3/auth/user/{user_id}"
payload := strings.NewReader("{\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"roles\": [\n \"<string>\"\n ],\n \"permissions\": {\n \"view\": {\n \"read\": true,\n \"write\": true,\n \"manage\": false\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.mezmo.com/v3/auth/user/{user_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"roles\": [\n \"<string>\"\n ],\n \"permissions\": {\n \"view\": {\n \"read\": true,\n \"write\": true,\n \"manage\": false\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mezmo.com/v3/auth/user/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"roles\": [\n \"<string>\"\n ],\n \"permissions\": {\n \"view\": {\n \"read\": true,\n \"write\": true,\n \"manage\": false\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"type": "<string>",
"page": {
"next": "<string>",
"previous": "<string>"
},
"pk": "<string>",
"links": {
"self": {
"list": {
"method": "get",
"uri": "https://api.mezmo.com/v3/auth/resource"
},
"detail": {
"method": "get",
"uri": "https://api.mezmo.com/v3/auth/resource/{resource_id}"
},
"update": {
"method": "patch",
"uri": "https://api.mezmo.com/v3/auth/resource/{resource_id}"
},
"replace": {
"method": "put",
"uri": "https://api.mezmo.com/v3/auth/resource/{resource_id}"
},
"create": {
"method": "post",
"uri": "https://api.mezmo.com/v3/auth/resource"
}
},
"related": {}
}
},
"data": {
"user_id": "5b7ca8b2b59ba49d58cc79ac",
"firstname": "John",
"lastname": "Doe",
"email": "member@snippetfactory.com",
"name": "John Doe",
"accounts": [
"25ef43eae1",
"b7bebbcd13"
],
"enterprise_ids": [
"25ef43eae1",
"b7bebbcd13"
],
"verified": true,
"isbanned": true,
"bandetails": {
"bannedat": "2026-01-15T12:00:00.000Z",
"banreason": "Unprofessional Conduct",
"bannedby": {
"name": "Jand Doe",
"email": "admin@snippetfactory.com"
}
},
"roles": [
"5b7ca8b2b59ba49d58cc79ac",
"5b8fa85cb59ba49d588942b3"
],
"permissions": {
"view": {
"read": true,
"write": true,
"manage": false
}
}
}
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}{
"status": 449,
"code": "<string>",
"message": "<string>",
"context": "body",
"errors": [
{
"keyword": "<string>",
"params": {},
"message": "<string>",
"instance_path": null,
"schema_path": null,
"property_name": null
}
]
}
