Upload my profile picture (user)
Sets the authenticated user's profile picture, replacing any previous one.
Send the file as multipart/form-data in the image field.
The picture is normalized once on upload: its EXIF orientation is applied, metadata (GPS, camera) is removed, it is center-cropped to a square, scaled down to at most 512×512 px (never up), and saved as a high-quality JPEG.
The response holds the new public link, also returned from now on by
GET /me as profile_picture_url:
https://cockpit.voxbi.com/avatar/{key} (optional ?size=32…512)
The link needs no token, is cacheable (Cache-Control: public, max-age=86400,
ETag), and changes with every upload. Requires a user-owned bearer token.
User bearer token. Default authentication for customer-facing endpoints.
Obtain a token by calling POST /login with your credentials, then send it
on every subsequent request as Authorization: Bearer <token>. The token
inherits the permissions and PBX scope of the authenticated user.
- HTTP Authorization Scheme
bearer- Bearer format
Bearer <token>
application/jsonRequest body · required · multipart/form-data
Responses
dataobject
Authorization Token is missingdataobject
errorsobject
https://cockpit.voxbi.com/api/v1/me/profile-picture
curl -X POST 'https://cockpit.voxbi.com/api/v1/me/profile-picture' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'image=@/path/to/image'
const body = new FormData();
body.append('image', fileInput.files[0]); // /path/to/image
const response = await fetch('https://cockpit.voxbi.com/api/v1/me/profile-picture', {
method: 'POST',
headers: { Authorization: `Bearer ${YOUR_TOKEN}` },
body,
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://cockpit.voxbi.com/api/v1/me/profile-picture',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'},
files={
'image': open('/path/to/image', 'rb'),
},
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$ch = curl_init('https://cockpit.voxbi.com/api/v1/me/profile-picture');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_TOKEN']);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'image' => new CURLFile('/path/to/image'),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);
{ … }
{ … }
"data": { … }
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057