Skip to content

Ask Pixel to change a customer's design

POST
/v1/pixel/designer
curl --request POST \
--url https://api.pixonaut.app/v1/pixel/designer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "prompt": "Put my name, Alva, on it in a playful font", "templateId": "tshirt-basic@2", "values": { "headline": { "content": "Class of 2026" } } }'

Operation ID: pixel.designer

Pixel, for the customer in the designer: from their prompt and their values as they stand, Pixel changes what the template offers them, within what each field allows, and may generate a picture for an offered picture or cut the customer’s picture out of its background, as the template’s settings allow. It never changes what the template keeps fixed. The answer is the values with Pixel’s changes, for the designer to apply. Paid from the workspace’s credits, within the template’s limits for one designer session (x-pixonaut-session, required) and the workspace’s monthly ceiling. Whatever stops it — the template or the workspace has it off, a limit or the ceiling is reached, or the credits run out — it answers 503 pixel_unavailable and nothing else, for the designer to say it did not work.

x-pixonaut-session

The designer’s browser session, which the SDK sends so one visitor’s uploads and proofs are told apart from another’s on the same key: 6 to 64 letters, digits, _ or -. Any other value is ignored.

string

The designer’s browser session, which the SDK sends so one visitor’s uploads and proofs are told apart from another’s on the same key: 6 to 64 letters, digits, _ or -. Any other value is ignored.

Media typeapplication/json
object
prompt
required

What the customer asks Pixel, in their own words.

string
>= 1 characters <= 2000 characters
templateId
required

The template version the designer shows, baseId@version.

string
values

The customer’s values as the designer holds them, by layer id and then prop, as a proof sends them.

object
key
additional properties
Any of:
object
key
additional properties

Examples

Exampleexample

Example

{
"prompt": "Put my name, Alva, on it in a playful font",
"templateId": "tshirt-basic@2",
"values": {
"headline": {
"content": "Class of 2026"
}
}
}

The customer’s values with Pixel’s changes

Media typeapplication/json
object
changed
required

Each field Pixel changed, in the order it first changed.

Array<object>
object
layerId
required
string
prop
required
string
cutOuts
required

Each picture Pixel is cutting out of its background: read GET /v1/assets/{id}/cut-out with its assetId until it is done, then put the cut-out in its place.

Array<object>
object
assetId
required
string
layerId
required
string
prop
required
string
layers
required

Each layer of the customer’s own Pixel added or removed, in the order it did, by the id it had then. values holds the layers that remain: the kinds under $added, each layer’s values under its id.

Array<object>
object
action
required
string
kind
required
string
layerId
required
string
reply
required

What Pixel says it did, for the customer, in their language.

string
values
required

The customer’s values with Pixel’s changes applied: what the designer shows next.

object
key
additional properties
Any of:
object
key
additional properties

Examples

Exampleexample

Example

{
"changed": [
{
"layerId": "name",
"prop": "content"
},
{
"layerId": "name",
"prop": "fontFamily"
}
],
"cutOuts": [],
"layers": [],
"reply": "I wrote Alva as the name and set it in Poppins.",
"values": {
"headline": {
"content": "Class of 2026"
},
"name": {
"content": "Alva",
"fontFamily": "Poppins"
}
}
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: no_session, invalid_input

Media typeapplication/json
object
error
required
string
reason

Always sent with invalid_input.

string

Examples

invalid_input

{
"error": "invalid_input",
"reason": "string"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: unauthorized

Media typeapplication/json
object
error
required
string

Examples

Exampleunauthorized

unauthorized

{
"error": "unauthorized"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: origin_forbidden, forbidden, feature_disabled

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: not_found

Media typeapplication/json
object
error
required
string

Examples

Examplenot_found

not_found

{
"error": "not_found"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: payload_too_large

Media typeapplication/json
object
bytes
number
error
required
string
maxBytes

Always sent with payload_too_large.

number

Examples

Examplepayload_too_large

payload_too_large

{
"error": "payload_too_large",
"maxBytes": 0
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: rate_limited

Media typeapplication/json
object
error
required
string

Examples

Examplerate_limited

rate_limited

{
"error": "rate_limited"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: db_error. A request that failed unexpectedly answers as text instead.

object
error
required
string

Examples

Exampledb_error

db_error

{
"error": "db_error"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: lock_timeout, pixel_unavailable

Media typeapplication/json
object
error
required
string

Examples

lock_timeout

{
"error": "lock_timeout"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Questions? Write to [email protected].

Status · Terms of service · Privacy policy · Subprocessors