Start uploading a file to an expiry
post
https://api.expiryedge.com/v1/getExpiryAttachmentUploadUrleditor or admin60/minIdempotency-Key
Request
curl -X POST 'https://api.expiryedge.com/v1/getExpiryAttachmentUploadUrl' \
-H "Authorization: Bearer $EXPIRYEDGE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"expiryId": "exp_4Tq9sLm2",
"file_name": "Gas Safety Certificate 2026.pdf",
"content_type": "application/pdf",
"size": 184022
}'Response
{
"upload_id": "pUp7x1",
"upload_url": "https://storage.googleapis.com/stylingsphere.appspot.com/user_files/org_northwind/u_71bXq/expiry_exp_4Tq9sLm2/1790517900000_Gas_Safety_Certificate_2026.pdf?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Signature=abc123",
"method": "PUT",
"headers": {
"Content-Type": "application/pdf",
"x-goog-content-length-range": "0,184022"
},
"expires_at": "2026-09-27T14:20:00.000Z",
"max_size": 184022
}Step 1 of 3. Returns a one-time upload link valid for 15 minutes. PUT the file bytes to upload_url
with exactly the returned headers, then call completeExpiryAttachmentUpload. Max 50 MB per file,
max 50 files per expiry, and the file must fit in your plan's storage quota.
Idempotency-KeystringOptional client-generated key (1-255 characters of letters, digits,- _ : .).pattern: ^[A-Za-z0-9_\-:.]{1,255}$
file_namestringrequiredmax length: 255content_typestringrequiredsizeintegerrequiredExact file size in bytes.min: 1 · max: 52428800expiryIdstringrequiredThe expiry to attach the file to.
201
Upload link created.
upload_idstringrequiredupload_urlstringrequiredSigned Google Cloud Storage URL.format: urimethodstringrequiredAllowedPUTheadersmap of stringrequiredexpires_atstringrequiredformat: date-timemax_sizeintegerrequired
400 | Validation failed, or the file type is not allowed ( UNSUPPORTED_FILE_TYPE). |
401 | Missing, expired or invalid bearer token. |
403 | Viewer role, no organization, or the plan's storage limit would be exceeded ( STORAGE_LIMIT_REACHED). |
404 | The record does not exist or is not in your organization. |
405 | The endpoint does not accept this HTTP method. |
409 | The expiry already has 50 attachments.; or a request with the same Idempotency-Key is still being processed (code IDEMPOTENCY_IN_PROGRESS). |
413 | The file is larger than 50 MB. |
422 | The Idempotency-Key was already used with a different request body. |
429 | Too many requests for this endpoint from your IP. Wait Retry-After seconds. |
500 | Unexpected server error. Retry later; quote requestId to support. |
