Create a claim for a connected entity
Creates a debt-recovery claim. message and document_refs become the first message, which starts Garfield's processing. If you send neither, the first message is a fixed note, so Garfield's processing still starts. Garfield acts on your messages as it would on the business's own. It sends nothing, charges nothing and files nothing at court until the business confirms that step in Garfield. Send each invoice's line_items, or attach the invoice for Garfield to read them from. The entity is always the claimant. Idempotent on partner_claim_id within each entity: a replay returns the first call's ids, after the same entity access and partner_user_id checks as a create. A replay with a different body returns 409 idempotency_key_reused. To correct or add to a claim, use POST /claims/{claim_id}/messages. See Create a claim.
Request
POST/claims
Responses
- 200
- 201
- 400
- 401
- 403
- 404
- 409
- 429
- 500
- 503
Replay: you already created a claim for this entity with this partner_claim_id. The response has the first call's message_id and document_ids, and Garfield attaches nothing new. A claim created before Garfield began storing these ids replays with message_id: null and document_ids: [].
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.
Garfield created the claim.
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.
partner_user_id_mismatch: the partner_user_id is not the one the entity connected with. The claim may be for the wrong business. Garfield created nothing. Check the entity_id on the console's Businesses page.
idempotency_key_reused: you already sent this partner_claim_id with a different body. Garfield created nothing. A claim created before Garfield began storing request bodies replays whatever body you send.
claim_conflict: an internal claim id collision. This is rare. Send the same request again. Garfield created nothing, so the retry creates the claim.
A repeated partner_claim_id with the same body is a replay and returns 200.
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.