Start an attachment upload

Preview
posthttps://api.expiryedge.com/v2/expiries/{id}/attachments
editor or admin60/minIdempotency-Key
Request
curl -X POST 'https://api.expiryedge.com/v2/expiries/exp_4Tq9sLm2/attachments' \
  -H "Authorization: Bearer $EXPIRYEDGE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "file_name": "Dental License 2026.pdf",
  "content_type": "application/pdf",
  "size": 482113
}'
Response
{
  "upload_id": "pUp7x1",
  "upload_url": "https://example.com",
  "method": "PUT",
  "headers": {
    "Content-Type": "application/pdf",
    "x-goog-content-length-range": "0,184022"
  },
  "expires_at": "2026-10-15T09:00:00Z",
  "max_size": 1
}

Returns a one-time signed URL. PUT the bytes to upload_url with exactly the returned headers, then call POST /v2/expiries/{id}/attachments/complete with the upload_id within 15 minutes. Max 50 MB per file and 50 files per expiry (409 TOO_MANY_ATTACHMENTS).

Path parameters

  • idstringrequired

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
    min: 1 · max: 52428800

Returns

201
Upload ticket.
  • 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
Invalid parameters or body (VALIDATION_FAILED; details names the fields).
401
Missing, invalid or expired token (UNAUTHORIZED).
403
Your role can't do this, or your account has no organization (FORBIDDEN).
404
No such record in your organization (records in other organizations are also 404).
405
Wrong HTTP method for this path; the Allow header lists the valid ones.
409
State or uniqueness conflict: EMAIL_EXISTS (contacts), GROUP_EXISTS (contact groups), CONFLICT (folder name taken), FOLDER_NOT_EMPTY, CLIENT_HAS_PROJECTS, TOO_MANY_ATTACHMENTS, INVALID_STATE (collection request cancel/resend), or IDEMPOTENCY_IN_PROGRESS (same Idempotency-Key still running; see Retry-After).
413
FILE_TOO_LARGE (over 50 MB).
422
The Idempotency-Key was already used with a different body (IDEMPOTENCY_KEY_REUSED).
429
Too many requests for this endpoint from your IP. Wait Retry-After seconds.