Send a template for a record
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/message-templates/v2-message-template-send.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/
Fills a saved template from one record and sends it now. It reaches a real customer or vendor and can't be recalled.
- Email templates send an email, with the template's attachments.
- Text message templates send a text through your Twilio integration.
Who gets it: for an email, the record's message participants who receive mail and messages, or the record's contact if there are none. For a text, the participants who receive texts; with none, nobody is texted.
Email limit: if your team goes over the daily email limit for its plan (60 a day on a free plan or trial, more on paid plans), YoPrint blocks email sending for your whole team until YoPrint support lifts the block. Space out bulk sends.
The six saved email types have no subject line of their own: their compiled subject is empty.
Compile it first to check the result. The response has no data.
Business rules
- Purchase order templates need the "send purchase order email" feature in your plan (422
plan_limitation). - A team on a trial can send only when YoPrint has turned on email for its trial, and a paid team needs an active subscription (otherwise 422
email_feature_not_enabled_in_trial). - Every team has a daily email limit. Going over it blocks the team's email sending until YoPrint support lifts the block.
Side effects
- Sends an email or a text message to the customer or vendor, and saves it with the record's messages.
- Document attachments (such as the order PDF) are made from the record at the time of sending.
- Spends money A text message is sent through your Twilio account and costs what Twilio charges.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
Request body
application/json, required.
The saved template's id.
The record it is about: a sales order or quote id for sales order and quote templates, a purchase order id for purchase order templates.
Response
200Successful response.
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.- When
- No template of your team has this
id. - Fix
- Use an id from the template list.
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
object_idis missing (validation_failed).- Fix
- Send the record's id.
- When
object_idis not a record of your team of the right kind:error.codesend_failed. Nothing is sent.- Fix
- Send a sales order or quote id for those templates, a purchase order id for purchase order templates.
- When
- Your plan doesn't allow purchase order emails (
plan_limitation), the trial doesn't allow email (email_feature_not_enabled_in_trial), or the team is over its daily email limit (validation_error, "You are sending too many emails..."). - Fix
- Read
error.message; contact YoPrint support if sending is blocked.
Related
- POSTFill in a template for a record
/v2/ api/ store/ {team_slug}/ setting/ message_template/ compile - GETList message templates
/v2/ api/ store/ {team_slug}/ setting/ message_template
