Attach uploaded files to a job
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/jobs/v1-sales-order-job-attach.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.
PUT/
Attaches files you uploaded first to a job, as mockups or production files. {id} is the job's id.
There is no separate v2 operation for this; in v2 you can also send files when you create or update a job. The answer is the job. Each job file carries its latest approval in current_approval; add ?omit_media_approval_items=1 to leave out that approval's items when you don't need them. {hash_id} is the order's id (for example V4keXwwxMQyXw7); the ord_ unique key is not accepted here.
Business rules
collectionismockuporproduction_file; mockups also needshow_in_pdf.- Each id must be a finished upload that is not attached anywhere yet.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
The sales order's or quote's
id(a hash id). Theord_unique key and the order number do not work here.- Example
V4keXwwxMQyXw7
- Example
The job's
id(a hash id).- Example
K6iF8n29iwOZnj
- Example
Query parameters
Send
1(ortrue,on,yes) to leaveitemsout of each job file'scurrent_approval, which makes the answer much smaller for jobs with many files on one approval. Every other key stays, in the same order, and the job'spending_approvalkeeps its items. Leave it out and the answer is unchanged. Only the query string counts: a body field of this name is ignored.- One of:
"1","true","on","yes" - Example
1
- One of:
Request body
application/json, required.
- At least 1 item
Fields of each item (6)
- One of:
"mockup","production_file"
- One of:
The upload's
id.Its place among the job's files.
job_serviceanyThe job service id (or ids) the file belongs to.
namestringshow_in_pdfbooleanRequired for mockups: show it on the order PDF.
Response
200Successful response.
A job.
Child fields (27)
The job number people see, such as
JOB-1001.The job's production status.
assigned_usersarray of objectsFields of each item (5)
avatar_urlstring | nullemailstringidstringnamestringtimezonestring | nullIANA time zone, for example
America/Chicago.
due_datestring (date-time) | nullProduction due. ISO 8601 with offset, or null.
impression_countstring | number | integer | nullItem count times decoration locations.
inventory_statusstring | nullis_rushbooleanitem_countstring | number | integer | nullTotal quantity of the job's lines (a decimal string or number).
mockuparray of objectsMockups.
Fields of each item (18)
collectionstringdefaultfor an order's files;mockuporproduction_filefor a job's.created_atstring (date-time) | nullWhen the file was uploaded (attaching it doesn't change this). ISO 8601 with offset, or null.
current_approvalobject | nullThe latest approval this file was sent in, as the approval operations return it, or null. When you send
omit_media_approval_items=1in the query string it has noitemskey; every other key stays.Child fields (18)
pending(created, not emailed),sent-to-customer,viewed-by-customer,need-changesorcompleted(approved). When it was completed without astatus, the Record answer showsnulland later reads show"".orderfor a whole-order approval,jobfor an artwork approval.- One of:
"order","job"
- One of:
approved_bystringcontactwhen a contact of the order's customer answered in the customer portal (seeapproved_by_contact_id),userwhen a team member recorded the answer (as Record the customer's answer does),customerotherwise, including before any answer.- One of:
"contact","user","customer"
- One of:
approved_by_contact_idstring | nullThe contact who answered in the customer portal, or null (always null when a team member recorded the answer).
approved_by_userstring | nullThe team member who recorded the answer, or null.
completedbooleantrue once the customer (or you, for them) answered: approved or changes needed.
completed_atstring (date-time) | nullWhen the customer answered. ISO 8601 with offset, or null.
created_atstring (date-time) | nullCreated. ISO 8601 with offset, or null.
customer_last_viewed_contact_idstring | nullThe contact who last opened it in the customer portal, or null when that isn't known.
customer_last_viewed_datestring (date-time) | nullWhen the customer last opened it. ISO 8601 with offset, or null.
itemsarray of objectsJob approvals: the mockups under review.
job_idstring | nullnotes_from_customerstring | nullnotes_to_customerstring | nullorder_idstringorder_scoped_idstringsignaturestring | nullThe signer's typed name.
current_approval_statusstring | nullpending-approvalwhile the latest approval this file was sent in is open; once that approval is answered, this file's own result from it; null when the file was never sent for approval.dimensionsobject | nullPixel size of an image; null otherwise.
file_namestringidstringis_imagebooleanjob_idstringThe job.
job_servicearray of stringsThe ids of the job's decoration services this file belongs to.
mime_typestringnamestringpositioninteger | number | nullpreview_statestringready: previews work.processing: a large image whose preview is still being made.too_large: over 120 megapixels, no preview.none: not an image.- One of:
"ready","processing","too_large","failed","none"
- One of:
show_in_pdfboolean | nullMockups: shown on the order PDF. Null on files that never had it set, such as an order's files.
sizeinteger | nullBytes.
urlstring | nullDownload link.
view_urlstring | null
namestring | nullnotestring | nullorder_scoped_idstringThe order number.
pending_approvalobject | nullThe job's open approval (the first one not yet answered), or null. It always keeps its
items, with or withoutomit_media_approval_items.- Same fields as
data.mockup[].current_approval.
- Same fields as
pipelinesarray of objectsWork pipelines (production steps).
positioninteger | nullpricing_original_totaldecimal pairThe same before pricing rules. A decimal pair: the amount is
value÷ 10^dp({ "value": 12500000, "dp": 6 }is 12.50). Kept with 6 decimal places; an amount never set can come as{ "value": 0, "dp": 0 }. Readdpevery time: it can differ between fields and records.- See Money and quantities.
pricing_rule_appliedobject | nullThe pricing rule that set the job's decoration price, or null when no rule did. List the jobs of a sales order or quote, Get one job and Rearrange the jobs answer with the full summary below. Other answers carry only
type, the two ids and the two totals.Child fields (12)
afterstringFull summary only: the price after the rule, as a decimal string.
after_totaldecimal pairThe job's decoration price after the rule. 6 decimal places. A decimal pair: the amount is
value÷ 10^dp({ "value": 1250, "dp": 2 }is 12.50). Readdpevery time: it can differ between fields and records.- See Money and quantities.
basestringFull summary only: the decoration price the rule started from, as a decimal string.
base_typestringFull summary only: always
service_priceon a job.- One of:
"service_price"
- One of:
normal_pricestring | nullFull summary only: the price with no rule; on a job the same as
base.original_totaldecimal pairThe job's decoration price before the rule. 6 decimal places. A decimal pair: the amount is
value÷ 10^dp({ "value": 1250, "dp": 2 }is 12.50). Readdpevery time: it can differ between fields and records.- See Money and quantities.
pricing_group_idstring | nullThe pricing group whose rule applied.
pricing_group_namestring | nullFull summary only: the group's name now.
pricing_group_removedboolean | nullFull summary only: true when the group was removed since. The job keeps its price.
pricing_rule_idstring | nullThe rule that applied.
ruleobject | nullFull summary only: the rule as the group holds it now, with its current name and position (1 is the first rule checked). Null when the rule no longer exists.
typestringserviceon a job.
pricing_totaldecimal pairDecoration price per unit that the job adds to each of its lines. A decimal pair: the amount is
value÷ 10^dp({ "value": 12500000, "dp": 6 }is 12.50). Kept with 6 decimal places; an amount never set can come as{ "value": 0, "dp": 0 }. Readdpevery time: it can differ between fields and records.- See Money and quantities.
production_filearray of objectsProduction files.
- Same fields as
data.mockup.
- Same fields as
sales_orderobjectA summary of the job's order.
Child fields (4)
is_rushbooleannamestring | nullobject_typestringstatus_idstring | null
servicesarray of objectsDecoration services:
service_id,location_*,option,position.services_still_validbooleanfalse when the job's decoration services need repair.
start_datestring (date-time) | nullProduction start. ISO 8601 with offset, or null.
statusobject | nullA status, as the status operations return it.
Child fields (9)
A hex color, such as
#2196f3.What customers see in the customer portal. When none is set:
Pendingforstart,In Progressforin_progressandpre_production,Completedforend.The status name people see.
Sort order within its list, lowest first.
Which list the status belongs to:
order,quote,job,shipment,purchase_order,pipelineorcustomer_message.true for a deleted status.
startis the first status of its list andendthe last;pre_productionandin_progressare the ones in between.- One of:
"start","pre_production","in_progress","end"
- One of:
pipeline_idstringThe task preset, for
pipelinestatuses only; absent for other roles.
unique_keystring | null
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
- The job or an upload does not exist.
- Fix
- Check the ids.
422Validation failed, or the image was refused by the media rules: a mockup that is not an image a preview can be made of (
mockup_type_not_allowed), or an image over a size limit (image_not_allowed), or a file that is a web page, a script or a program (validation_failedonmedia, orupload_not_allowed: "This type of file cannot be uploaded.");error.messageis one sentence naming the limit.- When
- A required field is missing.
- Fix
- Send
collection,positionand, for mockups,show_in_pdf.
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
- An id is a file already attached to something else, not a fresh upload (
{"message": "Server Error"}). - Fix
- Upload the file again and send the new id.
Notes
- The job is found by its id alone; make sure it belongs to the order in the path.
- Files are attached one at a time: when one fails, the ones before it stay attached.
- A file already on this job is not attached twice; its
show_in_pdf,nameand position are updated from the entry.
Related
- POSTUpload a file
/v1/ api/ store/ {team_slug}/ async_upload - PUTReorder the files of a job
/v1/ api/ store/ {team_slug}/ sales_order/ {hash_id}/ job/ {id}/ rearrange - PUTUpdate a job
/v2/ api/ store/ {team_slug}/ v2/ job/ {hash_id}
