Developers

Images

POST /api/v1/images uploads an image and gives the Markdown that shows it, and GET /api/v1/images reads the images in a Markdown body. The upload needs Write, the read needs Read.

Overview

POST /api/v1/images uploads an image to your workspace and gives you the Markdown that shows it. GET /api/v1/images takes a Markdown body and returns the images in it, each with a link that opens it. Use them to put a screenshot in a document, a comment or a job update, and to look at the images someone else put there.

An image lives in the workspace, not on a record. Every active member of the workspace can read every image in it, and so can a key of a member with the Read permission. An image's id is random, and it appears only in the body that shows the image.

The image types are PNG, JPEG, WebP and GIF, up to 10 MB. SVG is refused.

Authentication, Errors and Rate limits cover what every operation shares. This page covers the parameters and the fields.

Upload an image

POST /api/v1/images needs the Write permission. It records the image and returns a link you upload the bytes to. You send the bytes yourself, so the request itself carries only the name, the type and the size.

curl -X POST "https://attia.app/api/v1/images" \  -H "Authorization: Bearer $ATTIA_API_KEY" \  -H "Idempotency-Key: 0192f6a0-3c1d-7e2f-8a4b-5c6d7e8f9a01" \  -H "Content-Type: application/json" \  -d '{"file_name": "pipeline.png", "content_type": "image/png", "size": 48213}'

The body is a JSON object with these three fields, and all are required.

FieldTypeMeaning
file_namestringThe image's name, 1 to 255 characters with no control characters. It becomes the image's alt text
content_typestringimage/png, image/jpeg, image/webp or image/gif
sizeintegerThe image's size in bytes, from 1 to 10485760 (10 MB)

A body that is not a JSON object gets a 400 with the code invalid-request. So does a missing field, another type, image/svg+xml included, a size over 10 MB, a field outside this table and any query parameter. errors names each one.

The answer is a 201 with the image in data.

{  "data": {    "id": "0192f6a1-4d2e-7f30-9b5c-6d7e8f9a0b01",    "file_name": "pipeline.png",    "content_type": "image/png",    "size": 48213,    "url": "https://attia.app/api/v1/images/0192f6a1-4d2e-7f30-9b5c-6d7e8f9a0b01",    "markdown": "![pipeline.png](https://attia.app/api/v1/images/0192f6a1-4d2e-7f30-9b5c-6d7e8f9a0b01)",    "upload_url": "https://storage.example.com/object/upload/sign/workspace-images/...",    "upload_method": "PUT",    "upload_headers": { "Content-Type": "image/png" },    "upload_expires_in": 7200,    "created_at": "2026-11-01T09:12:44.310482Z"  }}
FieldTypeMeaning
idUUIDThe image's id. It never changes
file_namestringThe name you sent
content_typestringThe type you sent
sizeintegerThe size you sent, in bytes
urlstringThe image's address in Attia. A body points at the image with this address
markdownstring![<file_name>](<url>), ready to put in a body. Square brackets and backslashes in the name are left out of the alt text
upload_urlstringA signed link that takes the bytes of this one image
upload_methodstringPUT
upload_headersobjectThe headers to send with the bytes. Content-Type is the type you sent
upload_expires_inintegerSeconds until upload_url stops working: 7200
created_attimestampWhen the image was recorded

Then send the bytes with upload_method to upload_url, with the headers in upload_headers and no Authorization header:

curl -X PUT "$UPLOAD_URL" \  -H "Content-Type: image/png" \  --data-binary @pipeline.png

Storage refuses bytes of another type and bytes over 10 MB. The upload link works for two hours. Storage sets that time for every signed upload link, and Attia cannot make it shorter. A link that has expired gets an error from Storage; upload the image again to get a new one.

Until the bytes arrive the image is pending, and nothing reads it. Once they have arrived, put markdown in the body of a document, a comment or a job update, and the image shows there in the app.

A view-only workspace gets workspace-view-only.

Retry an upload safely

Every upload needs an Idempotency-Key header, as creating a job does. Pick a new value for each image: 1 to 255 letters, digits, - or _. An upload without one gets a 400 idempotency-key-required.

Within 24 hours, the same key with the same body and the same API key records no second image. It gets the same image back with a new upload_url, plus the header Idempotency-Replayed: true. The same key with another body or another API key gets a 422 idempotency-key-reused, and so does the same key after 24 hours, up to 90 days.

Read the images in a body

GET /api/v1/images needs the Read permission. It takes a Markdown body, finds each Attia image address in it, and returns the images your key can read, each with a link that opens it.

curl -G "https://attia.app/api/v1/images" \  -H "Authorization: Bearer $ATTIA_API_KEY" \  --data-urlencode "markdown=Before the call: ![pipeline.png](https://attia.app/api/v1/images/0192f6a1-4d2e-7f30-9b5c-6d7e8f9a0b01)"
ParameterTypeDefaultMeaning
markdownstring, up to 100000 charactersrequiredThe body to read, such as the body_markdown of a document

A missing markdown, a longer one and a parameter outside this table get a 400 with the code invalid-request.

The answer holds the images in data, in the order the body shows them, each once.

{  "data": [    {      "id": "0192f6a1-4d2e-7f30-9b5c-6d7e8f9a0b01",      "alt": "pipeline.png",      "content_type": "image/png",      "signed_url": "https://storage.example.com/object/sign/workspace-images/...",      "expires_in": 60    }  ]}
FieldTypeMeaning
idUUIDThe image's id
altstringThe alt text the body gives the image. Empty when it gives none
content_typestringimage/png, image/jpeg, image/webp or image/gif
signed_urlstringA link that returns the image's bytes. It needs no key
expires_inintegerSeconds until signed_url stops working: 60

The answer leaves out an image of another workspace, a pending image, and an address that is not an Attia image address, with no error. So a body with no images, or none you can read, answers an empty data. At most 50 images are read from one body.

Fetch signed_url soon after you get it. When it has expired, call GET /api/v1/images again for a new one.

Open an image

GET /api/v1/images/{id} is the address in url and in markdown. It answers a member signed in to the app, or an API key of the same workspace with the Read permission, with a redirect to a link that works for 60 seconds. That is how a document, a comment or a job update shows the image in the app. A member sees the images of every workspace they belong to, whichever one is open, and the workspace's IP restrictions apply to the member and the key alike.

curl -L "https://attia.app/api/v1/images/0192f6a1-4d2e-7f30-9b5c-6d7e8f9a0b01" \  -H "Authorization: Bearer $ATTIA_API_KEY" \  -o pipeline.png

The answer is a 302 with Cache-Control: private, no-store. Every other caller gets a 404: no sign-in, a key without Read, another workspace, a pending image and an image that does not exist. The 404 never tells you whether the image exists. A key over its rate limit gets a 429, as on every operation.