# Production items

## Add attachment to line items

> The API gives the ability to add attachment to line item.\
> \
> Allowed content-types:\
> \- \`image/png\`\
> \- \`model/obj\`\
> \- \`application/pdf\`\
> \- \`image/webp\`\
> \- \`image/jpeg\`\
> \- \`text/plain\`\
> \- \`application/vnd.hp-HPGL\`\
> \- \`application/vnd.ms-excel\`\
> \- \`application/msword\`\
> \- \`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\`\
> \- \`application/vnd.openxmlformats-officedocument.wordprocessingml.document\`

```json
{"openapi":"3.0.0","info":{"title":"Public API","version":"1.0"},"security":[{"PublicApiKey":[]}],"components":{"securitySchemes":{"PublicApiKey":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"PublicAddAttachmentToLineItemDto":{"type":"object","properties":{"file_name":{"type":"string","description":"File name"},"url":{"type":"string","description":"URL of the file"},"is_primary":{"type":"boolean","description":"Marks image as primary line item image"}},"required":["url"]},"MessageDto":{"type":"object","properties":{"message":{"type":"string","description":"Message returned from API confirming the operation"}},"required":["message"]}}},"paths":{"/api/v1/public/orders/{external_order_id}/line-items/{line_item_id}/attachments":{"post":{"description":"The API gives the ability to add attachment to line item.\n\nAllowed content-types:\n- `image/png`\n- `model/obj`\n- `application/pdf`\n- `image/webp`\n- `image/jpeg`\n- `text/plain`\n- `application/vnd.hp-HPGL`\n- `application/vnd.ms-excel`\n- `application/msword`\n- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `application/vnd.openxmlformats-officedocument.wordprocessingml.document`","operationId":"PublicProductionItemController_attachFilesToLineItem_v1","parameters":[{"name":"external_order_id","required":true,"in":"path","description":"The unique identifier of the order","schema":{"type":"string"}},{"name":"line_item_id","required":true,"in":"path","description":"The unique identifier of the production item","schema":{"type":"string"}},{"name":"x-tenant-id","in":"header","description":"Tenant id (uuid v4)","required":false,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAddAttachmentToLineItemDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageDto"}}}},"429":{"description":"Returned when the rate limit is exceeded","headers":{"X-RateLimit-Limit":{"description":"Maximum number of allowed requests during the current window","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Remaining number of requests before throttling occurs","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Number of seconds until the rate limit window resets","schema":{"type":"integer"}}}}},"summary":"Add attachment to line items","tags":["Production items"]}}}}
```

## Get current execution state for a line item

> Returns a list of active workflow cursors (tasks in progress, reopened, or ready to pick up) for a specific Line Item across all linked workflows.

```json
{"openapi":"3.0.0","info":{"title":"Public API","version":"1.0"},"security":[{"PublicApiKey":[]}],"components":{"securitySchemes":{"PublicApiKey":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"WorkflowStateDto":{"type":"object","properties":{"current":{"description":"Active element (Task or Workflow)","allOf":[{"$ref":"#/components/schemas/WorkflowItemDto"}]},"previous":{"description":"Previous tasks or workflow","type":"array","items":{"$ref":"#/components/schemas/WorkflowItemDto"}},"next":{"description":"Next tasks or workflow","type":"array","items":{"$ref":"#/components/schemas/WorkflowItemDto"}}}},"WorkflowItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":""},"production_workflow_id":{"type":"string","format":"uuid"},"task":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/TaskDto"}]},"nestedWorkflow":{"nullable":true,"description":"Nested workflow info","allOf":[{"$ref":"#/components/schemas/NestedWorkflowDto"}]}},"required":["id","production_workflow_id"]},"TaskDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"task_key":{"type":"string"},"status":{"type":"string","enum":["Reopened","In_Progress","On_Hold","To_Do","Blocked","Done","Canceled"]},"is_in_queue":{"type":"boolean"},"is_reopened":{"type":"boolean"},"reopened_task_key":{"type":"string","nullable":true}},"required":["id","status","is_in_queue","is_reopened"]},"NestedWorkflowDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["To_Do","Stopped","In_Progress","Done","Canceled","From_Stock"]},"production_key":{"type":"string"}},"required":["id","status"]}}},"paths":{"/api/v1/public/orders/state/{external_order_id}/line-items/{line_item_id}":{"get":{"description":"Returns a list of active workflow cursors (tasks in progress, reopened, or ready to pick up) for a specific Line Item across all linked workflows.","operationId":"PublicProductionItemController_getCurrentLineItemState_v1","parameters":[{"name":"external_order_id","required":true,"in":"path","description":"The unique identifier of the order","schema":{"type":"string"}},{"name":"line_item_id","required":true,"in":"path","description":"The unique identifier of the production item","schema":{"type":"string"}},{"name":"x-tenant-id","in":"header","description":"Tenant id (uuid v4)","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStateDto"}}}}},"429":{"description":"Returned when the rate limit is exceeded","headers":{"X-RateLimit-Limit":{"description":"Maximum number of allowed requests during the current window","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Remaining number of requests before throttling occurs","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Number of seconds until the rate limit window resets","schema":{"type":"integer"}}}}},"summary":"Get current execution state for a line item","tags":["Production items"]}}}}
```

## Get current execution state for a specific workflow

> Returns a list of active cursors for a single specific workflow by its ID.

```json
{"openapi":"3.0.0","info":{"title":"Public API","version":"1.0"},"security":[{"PublicApiKey":[]}],"components":{"securitySchemes":{"PublicApiKey":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"WorkflowStateDto":{"type":"object","properties":{"current":{"description":"Active element (Task or Workflow)","allOf":[{"$ref":"#/components/schemas/WorkflowItemDto"}]},"previous":{"description":"Previous tasks or workflow","type":"array","items":{"$ref":"#/components/schemas/WorkflowItemDto"}},"next":{"description":"Next tasks or workflow","type":"array","items":{"$ref":"#/components/schemas/WorkflowItemDto"}}}},"WorkflowItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":""},"production_workflow_id":{"type":"string","format":"uuid"},"task":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/TaskDto"}]},"nestedWorkflow":{"nullable":true,"description":"Nested workflow info","allOf":[{"$ref":"#/components/schemas/NestedWorkflowDto"}]}},"required":["id","production_workflow_id"]},"TaskDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"task_key":{"type":"string"},"status":{"type":"string","enum":["Reopened","In_Progress","On_Hold","To_Do","Blocked","Done","Canceled"]},"is_in_queue":{"type":"boolean"},"is_reopened":{"type":"boolean"},"reopened_task_key":{"type":"string","nullable":true}},"required":["id","status","is_in_queue","is_reopened"]},"NestedWorkflowDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["To_Do","Stopped","In_Progress","Done","Canceled","From_Stock"]},"production_key":{"type":"string"}},"required":["id","status"]}}},"paths":{"/api/v1/public/orders/state/{workflow_id}":{"get":{"description":"Returns a list of active cursors for a single specific workflow by its ID.","operationId":"PublicProductionItemController_getCurrentWorkflowState_v1","parameters":[{"name":"workflow_id","required":true,"in":"path","description":"Internal unique identifier of the Production Workflow","schema":{"type":"string"}},{"name":"x-tenant-id","in":"header","description":"Tenant id (uuid v4)","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStateDto"}}}}},"429":{"description":"Returned when the rate limit is exceeded","headers":{"X-RateLimit-Limit":{"description":"Maximum number of allowed requests during the current window","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Remaining number of requests before throttling occurs","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Number of seconds until the rate limit window resets","schema":{"type":"integer"}}}}},"summary":"Get current execution state for a specific workflow","tags":["Production items"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hesh.app/manuals/public-api/production-items.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
