Register a file upload
Registers a file and returns a presigned URL to upload it to. Files never pass through the API: send the bytes
with PUT to upload.url, with exactly the headers in upload.headers, within five minutes. Then use the
file's ID where a record takes one, for example selfie_file_id on a clock-in.
kind | Content types | Up to |
|---|---|---|
visitor_photo | image/jpeg, image/png, image/webp | 5 MB |
id_image | image/jpeg, image/png, image/webp | 10 MB |
signature | image/png | 1 MB |
selfie | image/jpeg, image/webp | 5 MB |
delivery_photo | image/jpeg, image/png, image/webp | 10 MB |
document | application/pdf | 20 MB |
badge | application/pdf, image/png | 5 MB |
answer_photo | image/jpeg, image/png, image/webp | 10 MB |
answer_file | application/pdf, image/jpeg, image/png, image/webp | 20 MB |
vehicle_photo | image/jpeg, image/png, image/webp | 10 MB |
delivery_label | image/jpeg, image/png, image/webp | 10 MB |
- The storage refuses an upload of another type or size, or after the link expires. Register the file again to get a new link.
- After the upload, Agoo removes the photo's metadata (EXIF, including any GPS location), checks that the
content matches its type and makes a thumbnail for photos. The file's
statusthen changes frompendingtoready, usually within seconds. A file whose content doesn't match its type is deleted. - A file that is never uploaded is deleted after a day. ID images, visitor photos and selfies are deleted on your organisation's retention schedule; ID images are kept for 30 days at most, and one that no visit uses is deleted within the hour.
- A Ghana Card is never photographed: Agoo records its number only (L.I. 2523). An
id_imagewithid_document_type: ghana_cardis refused, and so is a Ghana Card answer with animage. selfieneeds selfie evidence switched on in your attendance settings; otherwise you getvalidation_failedatbody.kind.
Scope: files:write · Plan: Pro and Enterprise in live mode; every plan in test mode.
AuthorizationBearer <token>Send Authorization: Bearer <token> on every request. The token is one of:
| Prefix | What it is | Where it may be used |
|---|---|---|
agoo_sk_live_ | Secret key, live mode | Your servers only |
agoo_sk_test_ | Secret key, test mode | Your servers only |
agoo_pk_live_ | Publishable key, live mode | Browsers and apps: create pre-registrations and bookings, read public booking types (with their intake questions) and their free slots, read the visit types open for pre-registration with their public forms. Never lists people. |
agoo_pk_test_ | Publishable key, test mode | As above, in test mode |
Admins create keys in Console → Developers → API keys and choose each key's scopes. A key is shown once. Never put a secret key in a URL, a browser or a mobile app.
Scope: files:write
Idempotency-Key*stringA UUID you generate for this operation. If you retry with the same key within 24 hours, Agoo returns the
original response instead of acting twice. While the first request is still running, a retry returns
conflict. Reusing a key with a different request returns idempotency_key_reused. Responses with
rate_limited, internal_error or unavailable aren't stored, so retry those with the same key.
uuidapplication/json- body
kind*FileKindWhat the file is: visitor_photo, id_image (an ID document, kept in separate storage and deleted on its
own schedule), signature, selfie (attendance evidence), delivery_photo, document (PDF), badge, or
answer_photo and answer_file (the answer to a form's photo or file question, which belongs to the visit), or
vehicle_photo (a vehicle at the gate, kept as long as the vehicle register), or delivery_label (a parcel's
label, kept with the parcel's other photos).
"visitor_photo""id_image""signature""selfie""delivery_photo""document""badge""answer_photo""answer_file""vehicle_photo""delivery_label"content_type*stringThe file's media type. See the table above for what each kind accepts.
length <= 100byte_size*integerExact size in bytes. See the table above for each kind's limit.
1 <= value <= 20971520id_document_type?stringFor an id_image: the document it's a photo of. A Ghana Card is never photographed: only its number is recorded (L.I. 2523), so ghana_card is refused.
"passport""drivers_licence""other""ghana_card"The registered file, with where to upload it.
application/json- response
A photo, ID image, signature, selfie, document or badge kept in Agoo's private storage.
id*FileIdA file ID (TypeID with the file prefix).
^file_[0-7][0-9a-hjkmnp-tv-z]{25}$"file_01m4z8vge0fkktt139dhkf42gw"kind*FileKindWhat the file is: visitor_photo, id_image (an ID document, kept in separate storage and deleted on its
own schedule), signature, selfie (attendance evidence), delivery_photo, document (PDF), badge, or
answer_photo and answer_file (the answer to a form's photo or file question, which belongs to the visit), or
vehicle_photo (a vehicle at the gate, kept as long as the vehicle register), or delivery_label (a parcel's
label, kept with the parcel's other photos).
"visitor_photo""id_image""signature""selfie""delivery_photo""document""badge""answer_photo""answer_file""vehicle_photo""delivery_label"status*stringpending until the upload is processed, then ready; deleted once retention or erasure removes it.
"pending""ready""deleted"content_type*stringThe file's media type.
byte_size*integerSize in bytes: as registered until processed, then the stored size (metadata removed).
1 <= valuesha256*|Hex SHA-256 of the stored file, once ready. Otherwise null.
has_thumbnail*booleantrue when a thumbnail was made (photos).
created_at*stringdate-timeready_at*|When processing finished. Otherwise null.
date-timedeleted_at*|When it was deleted. Otherwise null.
date-timeupload*|Where to upload the file. Only in the response to Register a file upload; null elsewhere.
curl -X POST 'https://api.agoohq.com/v1/files' \ -H 'Idempotency-Key: 3f6b2a1e-8c4d-4f7a-9b2e-5d1c0a7e9f64' \ -H 'Content-Type: application/json' \ -d '{ "kind": "selfie", "content_type": "image/jpeg", "byte_size": 184320}'{ "id": "file_01m4z8vge0fkktt139dhkf42gw", "kind": "selfie", "status": "pending", "content_type": "image/jpeg", "byte_size": 184320, "sha256": null, "has_thumbnail": false, "created_at": "2026-10-15T07:54:00Z", "ready_at": null, "deleted_at": null, "upload": { "url": "https://files.example.com/f/7Kq2Xp4Lm9Rt?expires=1791230400&signature=8b2e7d", "method": "PUT", "headers": { "Content-Type": "image/jpeg", "Content-Length": "184320" }, "expires_at": "2026-10-15T07:59:00Z" }}Get a form GET
Returns one form with its JSON Schema. `version` goes up each time an admin publishes a change in the form builder. **Scope:** `forms:read` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.
Retrieve a file GET
Returns a file's details and status. Poll it after uploading to see when the file is `ready`. Selfies are visible only to people who can read attendance, and to whoever uploaded them. ID images are visible only to Owners, Admins and Security leads signed in to Agoo (and to whoever uploaded one until it's processed): never to API keys or connected apps, which get `not_found`. **Scope:** `files:read` · **Plan:** Pro and Enterprise in live mode; every plan in test mode.