Upload an avatar
curl --request POST \
--url https://api.example.com/profile/me/avatar \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data'import requests
url = "https://api.example.com/profile/me/avatar"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'multipart/form-data'}
};
fetch('https://api.example.com/profile/me/avatar', 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.example.com/profile/me/avatar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/profile/me/avatar"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "multipart/form-data")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/profile/me/avatar")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "multipart/form-data")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/profile/me/avatar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'multipart/form-data'
response = http.request(request)
puts response.read_body{
"username": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"bio": "<string>",
"avatar_url": "<string>",
"email": "<string>",
"email_verified": true,
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "validation_error",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "blob_too_large",
"message": "<string>",
"details": {}
}
}Profile
Upload an avatar
Uploads an image as the user’s avatar. The accepted MIME types are enumerated on the request body schema. Subject to the standard blob size cap and the tenant’s blobs and storage_bytes quotas — over-size returns 413. The uploaded image is stored as a content-addressed blob; the public avatar_url on the profile reconstructs at read time.
POST
/
profile
/
me
/
avatar
Upload an avatar
curl --request POST \
--url https://api.example.com/profile/me/avatar \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data'import requests
url = "https://api.example.com/profile/me/avatar"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'multipart/form-data'}
};
fetch('https://api.example.com/profile/me/avatar', 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.example.com/profile/me/avatar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/profile/me/avatar"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "multipart/form-data")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/profile/me/avatar")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "multipart/form-data")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/profile/me/avatar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'multipart/form-data'
response = http.request(request)
puts response.read_body{
"username": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"bio": "<string>",
"avatar_url": "<string>",
"email": "<string>",
"email_verified": true,
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "validation_error",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "blob_too_large",
"message": "<string>",
"details": {}
}
}Authorizations
Body
multipart/form-data
The body is of type unknown.