curl --request POST \
--url https://api-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form imageProfile=@example-fileimport requests
url = "https://api-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile"
files = { "imageProfile": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('imageProfile', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile', 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-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"imageProfile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"imageProfile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"imageProfile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"imageProfile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"data": {
"imageProfileURL": "https://sesame-v2-prod-companies.s3.eu-west-3.amazonaws.com/48351485-1659-413d-bf7f-3ca34fadb521/public-read/g892f1fb-55a3-4e32-9cc9-7c19faa70gaa.png"
}
}{
"message": "Invalid or missing API Key",
"code": "UNAUTHORIZED"
}{
"message": "Rate limit exceeded. Please try again later.",
"code": "RATE_LIMIT_EXCEEDED",
"retryAfter": 60
}Upload the profile picture (avatar) of an employee
Uploads and replaces the employee’s profile picture.
Accepted formats: image/png and image/jpeg only. Any other content type (webp, heic, gif, svg, …) is rejected with 422 invalid_image_type.
Maximum size: 5 MB. Larger files are rejected with 422 file_too_large.
Resulting resolution: the image is resized server-side so that its longest side is at most 500 px, keeping the aspect ratio; images smaller than that are not scaled up. The stored file is re-encoded as JPEG regardless of the uploaded format.
Uploading a new picture replaces the previous one and deletes the previous file from storage. Each upload produces a new URL, so a client can detect changes by comparing the returned imageProfileURL with the one it stored previously.
curl --request POST \
--url https://api-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form imageProfile=@example-fileimport requests
url = "https://api-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile"
files = { "imageProfile": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('imageProfile', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile', 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-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"imageProfile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"imageProfile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"imageProfile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-{region}.sesametime.com/core/v3/employees/{employeeId}/image-profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"imageProfile\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"data": {
"imageProfileURL": "https://sesame-v2-prod-companies.s3.eu-west-3.amazonaws.com/48351485-1659-413d-bf7f-3ca34fadb521/public-read/g892f1fb-55a3-4e32-9cc9-7c19faa70gaa.png"
}
}{
"message": "Invalid or missing API Key",
"code": "UNAUTHORIZED"
}{
"message": "Rate limit exceeded. Please try again later.",
"code": "RATE_LIMIT_EXCEEDED",
"retryAfter": 60
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Employee ID
Body
The image file to store as the employee's profile picture
PNG or JPEG file, up to 5 MB
Response
The profile picture was stored and the new public URL is returned
Show child attributes
Show child attributes
Was this page helpful?