Filter messages
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/messages/v2-messages-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 messages like GET /v2/api/store/{team_slug}/messages, narrowed by direction or status, with an optional sort. For example, replies that still have no status: type in ["inbound"] and is_status_null eq true.
Each filter is {key, operator, value}. 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 message you can see. Keys:type,status,status_id,is_status_null.- For
type,statusandstatus_id,valueis a list andoperatorisinornin. Foris_status_null,valueistrueorfalse(JSON booleans) andoperatoriseqorneq. - Values of
typeandstatusare not checked: a word no message has just matches nothing. - Sort keys:
id,order_id,purchase_order_id,type,actor_type,created_at,status.
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.
filtersarray of objects- At least 1 item
Fields of each item (3)
type:outboundorinbound.status: the older delivery status word (delivered,delivery_failed,received, ...).status_id: your team's message status ids.is_status_null: whether a status is set.- One of:
"type","status","status_id","is_status_null"
- One of:
inorninwith a list, fortype,statusandstatus_id.eq(orneq, which is accepted and acts the same) withtrueorfalse, foris_status_null.- One of:
"in","nin","eq","neq"
- One of:
pageinteger- Minimum 1
sortarray of objects
Response
200Successful response.
Fields of each item (32)
actor_namestring | nullThe writer's name, by
actor_type: your team's name forsystem, the team member, the contact, the order's customer, the purchase order's vendor, the participant, or the name aguestgave. Null when YoPrint can't find the writer's record.actor_typestringWho wrote it:
user,customer,vendor,contact(written in the customer or vendor portal),participant,guest(someone who is not a contact) orsystem.attachmentsarray of objectsFiles attached to it, in the same shape as an upload (
id,name,file_name,mime_type,size,url).contactobject | nullThe contact who wrote it, when
contact_idis set:first_name,last_name,email,phoneand more.contact_idstring | nullcreated_atstring (date-time)customerobject | nullThe order's customer. Null without an order.
delivery_summaryobject | nullOutbound messages: how delivery went across all recipients. Null for inbound messages.
Child fields (12)
acceptedintegercompletebooleandeliveredintegerfailedintegerreasonstring | nullWhy the state is not final, or why nothing was sent, for example
no_recipientsordelivery_evidence_unavailable. Usually null.retryablebooleanTrue when the retry operation accepts this message. When false, it answers 422.
skippedintegerstatestringsent: the provider took it, delivery not confirmed yet.partial: recipients are in different states.not_sent: there were no recipients.- One of:
"pending","sending","sent","delivered","failed","partial","unknown","not_sent"
- One of:
submittingintegertotalintegerunknownintegerwaitinginteger
emailstring | nullThe sender's email address.
has_messagebooleanhas_original_messagebooleanidstringis_order_rushinteger | null1for a rush order,0otherwise (a number, not a boolean); null for a message without an order.- One of:
0,1
- One of:
modestring | booleanThe order's state in the web app:
viewonce it is created,createwhile it is a draft,editwhile someone is editing it.false(not null) without an order.namestring | nullThe sender's name.
order_idstring | nullThe sales order or quote it is on.
order_object_typestring | nullsales_orderorquote. Null without an order.order_quoteboolean | nullorder_scoped_idstring | nullThe order's number, such as
SO1001. Null without an order.participantobject | nullThe author, as a message participant, when
message_participant_idis set. Itsdelivery_*fields are null.Child fields (24)
can_receive_mailbooleancan_receive_smsbooleancontactobject | nullThe contact, for
typecontact:first_name,last_name,email,phoneand more.contact_idstring | nulldelivery_channelstring | null- One of:
"email","sms"
- One of:
delivery_created_atstring (date-time) | nulldelivery_destinationstring | nullThe email address or phone number it went to.
delivery_destination_namestring | nulldelivery_idstring | nullThe recipient id: the id the recipient operations take. Null on
participant.delivery_latest_error_reasonstring | nulldelivery_message_idstring | nulldelivery_participant_idstring | nulldelivery_statestring | nullFrom the provider's report. Null for older messages and on
participant.- One of:
"pending","sending","sent","delivered","failed","unknown"
- One of:
delivery_statusstring | null- One of:
"pending","dispatched","dispatch_failed","delivered","delivery_failed"
- One of:
delivery_updated_atstring (date-time) | nullemailstring | nullidstringThe participant id. The recipient operations take
delivery_id, not this.namestring | nullorder_idstring | nullphonestring | nullpurchase_order_idstring | nullstatusstringWhat they receive:
message,notification,allordisabled.trashedbooleantypestringuser: a team member.contact: one of the customer's or vendor's contacts.guest: just a name and email.- One of:
"user","contact","guest"
- One of:
preview_messagestring | nullA short plain-text preview.
purchase_order_idstring | nullThe purchase order it is on.
purchase_scoped_idstring | nullThe purchase order's number. An empty string
""(not null) when it is not on a purchase order.recipientsarray of objectsWho it was sent to: each participant with its delivery (
delivery_status,delivery_channel,delivery_destination).delivery_idis the id the recipient operations take.Fields of each item (24)
can_receive_mailbooleancan_receive_smsbooleancontactobject | nullThe contact, for
typecontact:first_name,last_name,email,phoneand more.contact_idstring | nulldelivery_channelstring | null- One of:
"email","sms"
- One of:
delivery_created_atstring (date-time) | nulldelivery_destinationstring | nullThe email address or phone number it went to.
delivery_destination_namestring | nulldelivery_idstring | nullThe recipient id: the id the recipient operations take. Null on
participant.delivery_latest_error_reasonstring | nulldelivery_message_idstring | nulldelivery_participant_idstring | nulldelivery_statestring | nullFrom the provider's report. Null for older messages and on
participant.- One of:
"pending","sending","sent","delivered","failed","unknown"
- One of:
delivery_statusstring | null- One of:
"pending","dispatched","dispatch_failed","delivered","delivery_failed"
- One of:
delivery_updated_atstring (date-time) | nullemailstring | nullidstringThe participant id. The recipient operations take
delivery_id, not this.namestring | nullorder_idstring | nullphonestring | nullpurchase_order_idstring | nullstatusstringWhat they receive:
message,notification,allordisabled.trashedbooleantypestringuser: a team member.contact: one of the customer's or vendor's contacts.guest: just a name and email.- One of:
"user","contact","guest"
- One of:
rendered_attachmentsarray of objectsEverything attached when it was sent: the files (
attachment_typemedia, upload shape) and generated documents such as the order PDF (attachment_typeinternal_attachment, withnameandurl).statusstring | nullOlder delivery status word, such as
pending,dispatched,partial_delivered,delivery_failed,delivered, orreceivedfor a reply. Preferdelivery_summary.status_idstring | nullYour team's message status (for example "Needs reply"), set with the status operation. Null when none is set.
systembooleanTrue for messages YoPrint sent automatically.
typestringoutbound: sent by your team.inbound: a reply received.- One of:
"outbound","inbound"
- One of:
userobject | nullThe team member who wrote it, when
user_idis set. The list sends their whole account profile; rely only onid,name,email,avatar_urlandtimezone, which the single message also has.user_idstring | nullvendorobject | nullThe purchase order's vendor. Null without a purchase order.
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, or a key, operator or value is not allowed (validation_failed, with the problem undererror.fields).- Fix
- Use the keys and operators listed here, or leave
filtersout.
Notes
- Without
sort, the order of results is not defined. Sendcreated_atdescwhen you page. is_status_nullonly readsvalue:truefinds messages without a status andfalsethose with one, whatever the operator.- Get
status_idvalues from your team's message statuses (GET /v1/api/store/{team_slug}/setting/status/customer_message).
Related
- GETList messages
/v2/ api/ store/ {team_slug}/ messages - GETList message thread statuses
/v1/ api/ store/ {team_slug}/ setting/ status/ customer_message
