Start uploading a file to an expiry

posthttps://api.expiryedge.com/v1/getExpiryAttachmentUploadUrl
editor 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.

Headers

  • Idempotency-Keystring
    Optional client-generated key (1-255 characters of letters, digits, - _ : .).
    pattern: ^[A-Za-z0-9_\-:.]{1,255}$

Body parameters

application/json
  • file_namestringrequired
    max length: 255
  • content_typestringrequired
  • sizeintegerrequired
    Exact file size in bytes.
    min: 1 · max: 52428800
  • expiryIdstringrequired
    The expiry to attach the file to.

Returns

201
Upload link created.
  • upload_idstringrequired
  • upload_urlstringrequired
    Signed Google Cloud Storage URL.
    format: uri
  • methodstringrequired
    AllowedPUT
  • headersmap of stringrequired
  • expires_atstringrequired
    format: date-time
  • max_sizeintegerrequired

Errors

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.