Save a set of status changes
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/statuses/v1-status-sync.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/
Creates, updates and deletes several statuses in one request, all or nothing. This is how the web app saves the status settings page, and the only way to move a list's start or end marker.
Call it as POST /v1/api/store/{team_slug}/setting/status/sync: the last path segment must be the word sync. Any other word answers 405.
Send data, a list of changes, each with an action:
create: a new status. Needslabel,color,role,type(in_progressorend) andposition.update: an existing status, byid. Sendpositionand what changes. Unlike the single update, it can changetype.delete: anin_progressstatus, byid.
Returns every status of the team, including deleted ones, like the full list.
Business rules
- All changes run in one transaction: if one fails, none is saved.
- Updating a status to
type: startorendturns the list's current start or end status intoin_progress, so each list keeps one of each. - A
startorendstatus can't be changed to another type directly. Mark another status as start or end instead. deleteworks only onin_progressstatuses; any other type fails the whole request with 500.createaccepts onlytypein_progressorend;startandpre_productionfail the whole request with 500. A createdendstatus does not demote the existing one.- Task statuses (
role: pipeline): this call doesn't decodepipeline_id, so a task status created here belongs to no task preset, and anupdatethat sendspipeline_iddetaches it from its preset. Use "Create a status" and "Update a status" for task statuses.
Side effects
- Team members who have YoPrint open see each change at once.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
Always the word
sync. Any other value answers 405.- One of:
"sync" - Example
sync
- One of:
Request body
application/json, required.
- At least 1 item
Fields of each item (9)
- One of:
"create","update","delete"
- One of:
colorstringA hex color with the
#, 3 or 6 digits:#1e88e5.- Matches
^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$
- Matches
customer_labelstringidstringRequired for
updateanddelete: the status to change.labelstringRequired for
create.pipeline_idstringDo not send. This operation does not link statuses to task presets. To create task statuses (
role: pipeline), use Create a status instead.positionintegerRequired for
createandupdate.- Minimum -2147483648
- Maximum 2147483647
rolestringRequired for
create. Which status list it belongs to (order,quote,job,purchase_order,pipeline, orshipment).customer_messagestatuses cannot be created here, and task statuses (pipeline) should be created with Create a status instead.- One of:
"order","quote","job","purchase_order","pipeline","shipment"
- One of:
typestringRequired for
create, which acceptsin_progressorend. Onupdate, settingstartorendmoves that stage marker to this status; see the rules.- One of:
"start","pre_production","in_progress","end"
- One of:
Response
200Successful response.
Fields of each item (9)
What customers see in the customer portal. When none is set:
Pendingforstart,In Progressforin_progressandpre_production,Completedforend.Sort order within the list, lowest first.
Which list the status belongs to:
order: sales ordersquote: quotesjob: jobspurchase_order: purchase ordersshipment: shipmentscustomer_message: message threadspipeline: tasks within a task preset
- One of:
"order","quote","job","purchase_order","shipment","customer_message","pipeline"
True for a deleted status. Only the full list includes deleted ones.
The stage of the status in the workflow:
start(first status in the list),pre_production,in_progress, orend(final status).- One of:
"start","pre_production","in_progress","end"
- One of:
pipeline_idstringThe task preset, for
pipelinestatuses only. Absent for every other role.
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.- When
- Your role lacks Manage Settings. The body is
{"message": "Insufficient Permission"}, without the error envelope. - Fix
- Use the key of a member whose role has Manage Settings, or the owner's.
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
- An
updateordeleteid is not one of your team's statuses. - Fix
- Use ids from the full 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
datais empty, an item has noaction, or acreateitem misses a required field (validation_failed).- Fix
- Send at least one change, each with its
actionand the fields that action needs.
500A business rule refused the request (see the operation's errors), or something failed inside YoPrint. Refusals use the error envelope with a code such as
action_not_allowed; an unexpected failure answers{"message": "Server Error"}. Repeating a refusal gets the same answer; after an unexpected failure, read the record back before you retry a change.- When
- A
deletetargets a status that is notin_progress, acreatehas the wrongtype, or astart/endstatus is updated to another type. The body is{"message": "Server Error"}, without the error envelope. - Fix
- Follow the rules above. Nothing was saved.
Related
- GETList every status, including deleted ones
/v1/ api/ store/ {team_slug}/ setting/ status - POSTCreate a status
/v1/ api/ store/ {team_slug}/ setting/ status - PATCHUpdate a status without checks
/v1/ api/ store/ {team_slug}/ setting/ status/ {status_reference}
