Update the authenticated user
curl --request PATCH \
--url https://api.01ads.com/v1/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Ada Lovelace"
}
'import requests
url = "https://api.01ads.com/v1/me"
payload = { "name": "Ada Lovelace" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Ada Lovelace'})
};
fetch('https://api.01ads.com/v1/me', 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.01ads.com/v1/me",
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([
'name' => 'Ada Lovelace'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.01ads.com/v1/me"
payload := strings.NewReader("{\n \"name\": \"Ada Lovelace\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.01ads.com/v1/me")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ada Lovelace\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.01ads.com/v1/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Ada Lovelace\"\n}"
response = http.request(request)
puts response.read_body{
"id": "k5vY2...",
"email": "ada@example.com",
"name": "Ada Lovelace",
"emailVerified": true,
"role": "user",
"image": "<string>"
}{
"type": "about:blank",
"title": "Validation Failed",
"status": 400,
"detail": "The request does not match the expected schema.",
"instance": "/v1/organizations/acme-corp/workspaces",
"requestId": "7c1b0c1e-5b7d-4b2a-9f1e-3c2d1a0b9e8f",
"errors": [
{
"path": "name",
"message": "Too small: expected string to have >=1 characters"
}
]
}{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"detail": "Authentication required. Sign in and try again.",
"instance": "/v1/organizations",
"requestId": "2f6a9c3d-1e4b-4a8c-b7d2-5e0f1a2b3c4d"
}{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"instance": "/v1/me",
"detail": "<string>",
"requestId": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}account
Update the authenticated user
Changes the caller’s display name (the email is the sign-in identity and never changes here). Writes a user.updated audit event. Sessions only: API keys are refused.
PATCH
/
v1
/
me
Update the authenticated user
curl --request PATCH \
--url https://api.01ads.com/v1/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Ada Lovelace"
}
'import requests
url = "https://api.01ads.com/v1/me"
payload = { "name": "Ada Lovelace" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Ada Lovelace'})
};
fetch('https://api.01ads.com/v1/me', 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.01ads.com/v1/me",
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([
'name' => 'Ada Lovelace'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.01ads.com/v1/me"
payload := strings.NewReader("{\n \"name\": \"Ada Lovelace\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.01ads.com/v1/me")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ada Lovelace\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.01ads.com/v1/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Ada Lovelace\"\n}"
response = http.request(request)
puts response.read_body{
"id": "k5vY2...",
"email": "ada@example.com",
"name": "Ada Lovelace",
"emailVerified": true,
"role": "user",
"image": "<string>"
}{
"type": "about:blank",
"title": "Validation Failed",
"status": 400,
"detail": "The request does not match the expected schema.",
"instance": "/v1/organizations/acme-corp/workspaces",
"requestId": "7c1b0c1e-5b7d-4b2a-9f1e-3c2d1a0b9e8f",
"errors": [
{
"path": "name",
"message": "Too small: expected string to have >=1 characters"
}
]
}{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"detail": "Authentication required. Sign in and try again.",
"instance": "/v1/organizations",
"requestId": "2f6a9c3d-1e4b-4a8c-b7d2-5e0f1a2b3c4d"
}{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"instance": "/v1/me",
"detail": "<string>",
"requestId": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}Authorizations
Session token as Authorization: Bearer (the CLI and scripts).
Body
application/json
Display name
Required string length:
1 - 255Example:
"Ada Lovelace"
Response
The updated user
User id
Example:
"k5vY2..."
Verified sign-in email
Example:
"ada@example.com"
Display name
Example:
"Ada Lovelace"
Whether the email is verified
Platform role; user for every regular account
Example:
"user"
Avatar URL, if any
Was this page helpful?