Get a signed URL to upload a document
Returns a signed URL to upload one document.
Each document needs two requests:
- Call this endpoint. It returns an
upload_urland astorage_path. PUTthe file to theupload_urlwith therequired_headers. This request goes to Google Cloud Storage, so leave out the bearer token.
Then send the storage_path in document_refs on POST /claims, with the same partner_claim_id. To add a document to a claim that already exists, request the upload URL with that claim's partner_claim_id, then send the storage_path in POST /claims/{claim_id}/messages. See Create a claim.
Request
POST/documents/upload-url
Responses
- 201
- 400
- 401
- 403
- 404
- 429
- 500
- 503
Garfield created the signed upload URL.
Response Headers
The maximum number of requests your partner account can send in each window. Only production enforces limits and sends this header.
The window length in seconds, always 60. The API does not report how much of the current window is left. Only production sends this header.
The body is not valid. code is validation_failed (see details), invalid_json (not valid JSON) or body_required (no body, or Content-Type is not application/json). POST /claims and POST /claims/{claim_id}/messages also return document_path_invalid (a storage_path is not in the upload folder for this entity and partner_claim_id, or, on POST /claims/{claim_id}/messages, is already attached to the claim) or document_not_uploaded (a file in document_refs is not in storage).
Authentication failed. code gives the cause: auth_missing (no Authorization header), auth_invalid_format (the token has no pk_test_ or pk_live_ prefix, or its format is not valid), auth_revoked (Garfield revoked your partner account or rejected your application, or you revoked the key) or auth_bad_secret (the partner id, key id or secret is incorrect, or the prefix does not match the key's mode).
The key is valid but does not have access. code gives the cause: auth_partner_not_approved (Garfield has not approved your partner account yet, so only test keys work), entity_not_owned (the entity is not connected to you and is not your own), partner_disconnected (the entity disconnected from you, so you cannot read or write its claims) or entity_not_verified (Garfield has not verified the business yet, or rejected it, so uploads, claims and messages fail while every read still works).
No entity has this id, or you sent a real entity_id with a test key.
Too many requests. Each partner can send 120 requests per minute across all endpoints and keys, and only requests with a verified key count. Until Garfield approves a partner, the limit is 30 requests per minute. Requests that fail authentication count separately, 10 per minute for each IP address. Past that, fix the key before you send more requests. For the partner limit, wait the number of seconds in Retry-After, then retry. The API counts requests per minute as they arrive, so treat the limits as approximate.
Response Headers
The number of seconds to wait before you retry.
The maximum requests in each window, for the limit you exceeded.
Only on a 429, where it is 0. The API does not report a running count.
The window length in seconds, always 60. The API does not report how much of the current window is left. Only production sends this header.
A server error. code is internal_error. Retry with exponential backoff.
A dependency is temporarily unavailable. code is service_unavailable, or document_verification_failed when the API could not check an uploaded document in storage. Retry after Retry-After when the response has it, otherwise with exponential backoff.
Response Headers
The number of seconds to wait before you retry.