Skip to content

Create Embroidery Task ​

Overview ​

Asynchronously generate an embroidery DST file and preview image from one input image. Use the returned task ID with Query Task to retrieve status and results.

ProtocolEndpointMethodAuthenticationRequest formatResponse format
HTTPS/open-api/v1/embroidery/create-taskPOSTBearermultipart/form-dataapplication/json

Headers ​

ParameterValueDescription
AuthorizationBearerToken returned by Get Token
Content-Typemultipart/form-dataWith FormData or curl --form, let the client generate the header with its boundary

Request Body (HTTP Form) ​

ParameterTypeRequiredDescription
imagefileExactly one of image and image_urlOne nonempty png, jpeg, jpg, or webp image; maximum 20 MB (20 × 1024 × 1024 bytes)
image_urlstringExactly one of image and image_urlOne accessible HTTP(S) image URL; same image format and size limits as image
widthnumberYesFinished item width in mm; 30–200 inclusive; decimals supported, for example 100.25
color_countintYesMaximum number of colors; integer from 1 to 16 inclusive
densityintYesStitch density: 1=low, 2=medium, 3=high; integer only

Do not provide both image and image_url or omit both. width, color_count, and density have no defaults and must be supplied. URL requests also use multipart/form-data.

Output is a DST file and preview image. Do not supply format, model, or version. callback_url is currently unsupported; poll the query endpoint.

Response ​

ParameterChild fieldTypeDescription
code-int200 means submission succeeded, not that generation is complete
datatask_idstringAsynchronous task ID
statestringqueueing after successful submission
msg-stringResponse message
json
{"code":200,"data":{"task_id":"embroidery_example_task","state":"queueing"},"msg":"success"}

Error Codes ​

CodeExample messageDescription
1003width only supports 30-200 mmInvalid parameter range, type, or missing required value
1003color_count only supports 1-16Color count outside the allowed range
1003density only supports 1, 2, 3Unsupported density
1003width is requiredMissing required field; other fields follow the same field-name and validation-message format
10031001Upload file size exceeds limitImage exceeds the size limit
10031005images only allow png jpeg jpg webpUnsupported image format
10031019image and image_url must provide exactly oneMissing or conflicting image sources

Errors use the standard code and msg response fields. Messages may vary with language and error type. Handle errors by code rather than matching the full message.

Request Examples (Shell) ​

File upload:

shell
curl --location 'https://api.hitem3d.ai/open-api/v1/embroidery/create-task' \
  --header 'Authorization: Bearer {{token}}' \
  --form 'image=@"/path/to/input.png"' \
  --form 'width=100' \
  --form 'color_count=8' \
  --form 'density=2'

Image URL:

shell
curl --location 'https://api.hitem3d.ai/open-api/v1/embroidery/create-task' \
  --header 'Authorization: Bearer {{token}}' \
  --form 'image_url=https://example.com/input.png' \
  --form 'width=100' \
  --form 'color_count=8' \
  --form 'density=2'