Filter approvals by type or status
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/approvals/v1-approvals-filter.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
POST/
Lists approvals like GET /v1/api/store/{team_slug}/approvals, narrowed by type and status, with an optional sort. For example, everything still waiting on the customer: status in pending, sent-to-customer, viewed-by-customer.
Each filter is {key, operator, value} with operator in or nin and value a list. Several filters must all match. Send page in the body or the query string.
Business rules
filtersis optional. If you send it, it can't be empty. Leaving it out returns every approval, like the list. Filter keys aretypeandstatusonly.valuemust be a list, even for one value.- Sort keys:
id,order_id,job_id,type,completed_at,created_at,status;directionascordesc.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
Request body
application/json, optional.
Response
200Successful response.
Fields of each item (24)
approved_bystringuserwhen a team member completed it. Otherwisecustomer, even before anyone has approved it, and also when a Customer Portal contact approved it (Get an approval names the contact).- One of:
"user","customer"
- One of:
approved_by_userstring | nullThe hash id of the team member who completed it on the customer's behalf, if any.
completedbooleanTrue once the customer finished, whether they approved or asked for changes.
completed_atstring (date-time) | nullcreated_atstring (date-time)customer_idinteger | nullA plain number for the customer, not a hash id: no operation takes it. Use
order_idto reach the customer.customer_last_viewed_datestring (date-time) | nullcustomer_namestring | nullidstringjob_idstring | nullJob approvals only.
job_namestringAn empty string for order approvals.
job_scoped_idstringThe job number, such as
JOB-1001. An empty string for order approvals.notes_from_customerstring | nullnotes_to_customerstring | nullorder_external_typestring | nullorder_idstring | nullorder_namestring | nullorder_object_typestring | nullsales_orderorquote.- One of:
"sales_order","quote"
- One of:
order_quotebooleanTrue when the approval is on a quote.
order_scoped_idstringThe order or quote number.
request_bystring | nullA team member's hash id, or null. Approvals created in the web app or through the API are null here: neither records who requested them.
signaturestring | nullThe customer's signature, when they signed.
statusstringpending: not sent yet.sent-to-customer: emailed.viewed-by-customer: the customer opened it.need-changes: the customer finished and asked for changes ("Review requested").completed: approved.- One of:
"pending","sent-to-customer","viewed-by-customer","need-changes","completed"
- One of:
typestringjob: artwork approval for one job's mockups.order: approval of the whole order.- One of:
"job","order"
- One of:
paginationobjectChild fields (6)
Links to the neighbouring pages:
previousandnext, each present only when that page exists. An empty list,[], when there is only one page.
Errors
401The API key is missing or wrong (
unauthenticated).403You are not allowed to do this.
api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only{"message": "Insufficient Permission"}. Other refusals use the error envelope, withunauthorizedoruser_is_not_authorized.404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.422The request was refused and changed nothing.
validation_failedlists what to fix inerror.fields; other codes name a business rule, explained inerror.message. A few checks answer with only{"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answerconnect_timeout("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.- When
filtersis an empty list, a key or operator is not allowed,valueis not a list, or a sortkeyordirectionis not allowed (validation_failed, with the problem undererror.fields).- Fix
- Send at least one
{key, operator, value}with an allowed key,inornin, and a list, or leavefiltersout. Writedirectionin lower case.
Notes
- Without
sort, the order of results is not defined. Send a sort, such ascreated_atdesc, when you page.
Related
- GETList approvals
/v1/ api/ store/ {team_slug}/ approvals
