Start attaching a file to a Docs page (get an upload link)
post
https://api.expiryedge.com/v1/getKnowledgeDocAttachmentUploadUrleditor or admin60/minIdempotency-Key
Request
curl -X POST 'https://api.expiryedge.com/v1/getKnowledgeDocAttachmentUploadUrl' \
-H "Authorization: Bearer $EXPIRYEDGE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"id": "kd_7Hn2qLx",
"file_name": "food-hygiene-renewal-checklist.pdf",
"content_type": "application/pdf",
"size": 184022
}'Response
{
"upload_id": "pUp7x1",
"upload_url": "https://storage.googleapis.com/expiryedge.appspot.com/organizations/org_northwind/docs/kd_7Hn2qLx/attachments/1790000000000_food-hygiene-renewal-checklist.pdf?X-Goog-Signature=...",
"method": "PUT",
"headers": {
"Content-Type": "application/pdf",
"x-goog-content-length-range": "0,184022"
},
"expires_at": "2026-09-27T14:35:00.000Z",
"max_size": 184022
}Step 1 of 3. PUT the file bytes to upload_url with the returned headers within 15 minutes,
then call completeKnowledgeDocAttachmentUpload with upload_id.
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: 52428800idstringrequiredPage id.
201
Upload link issued.
upload_idstringrequiredupload_urlstringrequiredSigned Google Cloud Storage URL.format: urimethodstringrequiredAllowedPUTheadersmap of stringrequiredexpires_atstringrequiredformat: date-timemax_sizeintegerrequired
400 | Invalid request ( VALIDATION_FAILED) or a file type that is not allowed (UNSUPPORTED_FILE_TYPE). |
401 | Missing, expired or invalid bearer token. |
403 | Viewer role, no organization, or the plan 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 | A request with the same Idempotency-Key is still being processed. Retry after Retry-After seconds. |
413 | FILE_TOO_LARGE - the file is over 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. |
