Skip to main content
PATCH
Update a rule

Authorizations

Authorization
string
header
required

Your secret key as a bearer token, e.g. Authorization: Bearer sk_live_…. Secret keys are server-side only.

Path Parameters

id
string
required

The rule id.

Query Parameters

dryRun
boolean
default:false

Validate and check references without saving: the response shows the record as it would be saved.

Body

application/json

An upload rule (intake rule): the contract for what a customer may upload for one product and how each file is judged at upload time, while the customer waits. A workflow points at exactly one rule through workflow.intake.ruleId, and many workflows can share a rule. For each uploaded file FileCheck detects the real type from the file's bytes, picks the matching entry in accepts (exact MIME type first, then the first entry of the same kind that is not mimeTypesStrict), optionally converts it to PDF, preflights it against the preflight profile that entry names (accepts[].preflight.profileId; profiles hold the checks and thresholds, a rule only points at them), and turns a failing result into reject / accept-with-warnings / manual-review through that entry's onFail. Accepted files then feed the workflow stream for their kind (pdf, raster or other). cardinality says how many files the product needs. A rule does no downstream processing: autofix, optimize, imposition, proofing and delivery are configured on the workflow.

accepts
any[]
required

The file types this product takes, normally one entry per kind (the dashboard allows only one), each with its own MIME list, size limit, PDF conversion, preflight profile and failure policy. For an upload, the first entry whose mimeTypes lists the file's detected MIME type wins; failing that, the first entry of the file's kind that is not mimeTypesStrict. A file no entry matches is refused by the widget when rejectUnknownTypes is true, but one sent through the API is stored unchecked, so cover every kind you expect.

Required array length: 1 - 20 elements
title
string

Name of the rule in the dashboard library and in workflow pickers, e.g. "Business Card — Front & Back". Keep it under 60 characters, the dashboard editor's limit.

Required string length: 1 - 120
description
string
default:""

Note for the print shop's dashboard: which product this rule is for and which profile it pairs with. Never shown to customers.

Maximum string length: 2000
instructions
string
default:""

Short instruction shown to the customer in the upload widget, e.g. "Upload a print-ready PDF with 3 mm bleed on all sides." Plain text only: the widget renders it as HTML in slot mode, so angle brackets are refused.

Maximum string length: 2000
Pattern: ^[^<>]*$
tags
string[]

Free labels for finding the rule in the dashboard library (e.g. "pdf", "business-card"). No effect on uploads.

Maximum array length: 50
Required string length: 1 - 64
schemaVersion
enum<integer>
default:1

Record format version. Always 1.

Available options:
1
cardinality
object

How many files one order of this product needs: either a count range (min and max) or named slots (one labelled upload per slot, e.g. Front and Back). Omit it for exactly one file. A product page can override min and max per order through the job's fileCount context.

rejectUnknownTypes
boolean
default:true

When true the upload widget refuses files that match no accepts entry; when false it lets them through and they are stored unchecked. Only the widget reads this: files submitted through the API that match no entry are always taken unchecked.

maxTotalSize
integer | null

Intended cap on the combined size of one order's files, in bytes. Stored and shown in the dashboard but not enforced anywhere today; use accepts[].maxSize for a limit that works. Omit or null for none.

Required range: x >= 1
uploadOptional
boolean
default:false

When true a customer who uploads nothing may continue: the widget's checkout gate opens with zero files. Once any file is uploaded, cardinality and onFail apply as usual, and a rejected file still blocks.

channels
enum<string>[]

Reserved for limiting the rule to submission channels (client = the storefront widget, api, admin, store). Not enforced today: leave it empty, which means all channels.

Available options:
client,
api,
admin,
store
ui
object

Look-and-feel overrides for the storefront upload widget while it shows this rule. A key set here overrides the account default and is overridden by the host page; leave a key out to inherit. Never affects which files are accepted.

Response

OK

rule
Rule · object

An upload rule (intake rule): the contract for what a customer may upload for one product and how each file is judged at upload time, while the customer waits. A workflow points at exactly one rule through workflow.intake.ruleId, and many workflows can share a rule. For each uploaded file FileCheck detects the real type from the file's bytes, picks the matching entry in accepts (exact MIME type first, then the first entry of the same kind that is not mimeTypesStrict), optionally converts it to PDF, preflights it against the preflight profile that entry names (accepts[].preflight.profileId; profiles hold the checks and thresholds, a rule only points at them), and turns a failing result into reject / accept-with-warnings / manual-review through that entry's onFail. Accepted files then feed the workflow stream for their kind (pdf, raster or other). cardinality says how many files the product needs. A rule does no downstream processing: autofix, optimize, imposition, proofing and delivery are configured on the workflow.

dryRun
boolean

Present and true when nothing was saved.