Set the workspace image
PUT/api/v1/workspace/image
PUT /workspace/image
curl -X PUT 'https://www.unitpost.com/api/v1/workspace/image' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'User-Agent: my-app/1.0' \
-H 'Content-Type: application/json' \
-d '{ }'Response · 200
{
"object": "workspace",
"id": "id_123",
"name": "Example",
"slug": "string",
"image_url": "https://example.com"
}Replace the workspace image (its avatar in the dashboard, and the email logo when there's no brand logo), from a public https url or base64 data (PNG, JPEG, GIF or WebP, up to 5 MB and 16,384 px a side). Requires the branding:write capability.
Request body4 fields
| Field | Type | Description |
|---|---|---|
url | string | A public https image to fetch (no redirects, no private addresses). PNG, JPEG, GIF or WebP, up to 5 MB and 16,384 px a side (50 megapixels at most); anything else is a 422 naming `url`. |
data | string | The image bytes, base64 (no `data:` prefix). Base64 adds a third, and a request over ~6 MB is refused before it arrives, so this fits about 4 MB of image; send larger images (up to 5 MB) by `url`. At most 16,384 px a side and 50 megapixels; anything else is a 422 naming `data`. |
content_type | enumimage/png | image/jpeg | image/gif | image/webp | Required with `data`; refused with `url` (the server sends the type). |
filename | string | Shown in the library. Defaults to the URL's file name, or `image`. |
Response · 200 fields5 fields
| Field | Type | Description |
|---|---|---|
objectrequired | string | — |
idrequired | string | — |
namerequired | string | — |
slugrequired | string | — |
image_urlrequired | string | null | The workspace image (its avatar in the dashboard). |
200400401403422429502503