> ## Documentation Index
> Fetch the complete documentation index at: https://integration.delogue.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage care instructions

> Build and maintain the organisation's care instruction library — the washing and handling instructions that appear on style care labels.

<Info>
  **When to use this.** Care instructions are reusable library records for a brand: you create
  them once with a stable user-defined ID, optionally translate them into multiple languages, and
  then select them on styles to drive care label output. Use these endpoints to build and
  maintain that library. Multi-language support requires a Professional licence.
</Info>

## The workflow

A care instruction is an organisation-level record. The typical path is to create the
instructions, keep them active for selection on styles, and retire or bulk-update them as
your labelling requirements evolve.

<Steps>
  <Step title="Create instructions">
    `POST /api/care-instructions` with the default text and an optional user-defined ID. Pass an
    array — one or many instructions are created in a single all-or-nothing transaction.
  </Step>

  <Step title="Add translations (optional)">
    Include a `languages` array in the create body, or update an existing instruction via
    `PUT /api/care-instructions/{id}` with a replacement `languages` list. Requires a
    Professional licence and at least one language configured under Admin > General Settings.
  </Step>

  <Step title="Find instructions">
    `GET /api/care-instructions` with filters (`text`, `userDefinedIds`, `state`) to look up
    instructions for import verification or to drive a selection UI.
  </Step>

  <Step title="Retire or bulk-manage">
    Use `PUT /api/care-instructions/{id}` to deactivate a single instruction, or
    `PUT /api/care-instructions` (bulk) to update positions, states, and translations — or
    hard-delete multiple instructions — in one transaction using `state: "Deleted"` on those
    items.
  </Step>
</Steps>

```mermaid theme={"dark"}
sequenceDiagram
  participant D as Designer
  participant API as Delogue API
  D->>API: POST /api/care-instructions  (with languages)
  API-->>D: care instruction id(s)
  D->>API: GET /api/care-instructions  (filter by state/text)
  API-->>D: paginated list
  D->>API: PUT /api/care-instructions/{id}  (update text or translations)
  API-->>D: updated instruction
  D->>API: DELETE /api/care-instructions/{id}  (when no longer used on any style)
  API-->>D: deleted instruction (state: Inactive)
```

## Walkthrough

Create two care instructions in a single call — one with a Danish translation, one without.
The body is an array so both are committed atomically.

<CodeGroup>
  ```bash cURL theme={"dark"}
  curl -X POST "https://service.my.delogue.com/api/care-instructions" \
    -H "Accept: application/json" \
    -H "X-Auth-Token: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '[
    {
      "userDefinedId": "KAF",
      "text": "Keep away from Fire",
      "isActive": true,
      "languages": [
        {
          "languageId": 1,
          "text": "Hold væk fra åben ild"
        }
      ]
    },
    {
      "userDefinedId": "DCSC",
      "text": "Dry Clean, Short Cycle",
      "isActive": true,
      "languages": null
    }
  ]'
  ```

  ```js JavaScript theme={"dark"}
  const res = await fetch("https://service.my.delogue.com/api/care-instructions", {
    method: "POST",
    headers: {
      "Accept": "application/json",
      "X-Auth-Token": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify([
    {
      "userDefinedId": "KAF",
      "text": "Keep away from Fire",
      "isActive": true,
      "languages": [
        {
          "languageId": 1,
          "text": "Hold væk fra åben ild"
        }
      ]
    },
    {
      "userDefinedId": "DCSC",
      "text": "Dry Clean, Short Cycle",
      "isActive": true,
      "languages": null
    }
  ]),
  });
  const { data } = await res.json();
  ```
</CodeGroup>

```json theme={"dark"}
{
  "status": "success",
  "code": "care_instructions_created",
  "data": [
    {
      "id": 4160,
      "userDefinedId": "KAF",
      "text": "Keep away from Fire",
      "state": "active",
      "position": 1,
      "properties": [],
      "languages": [
        {
          "id": 5500,
          "languageId": 1,
          "text": "Hold væk fra åben ild"
        }
      ]
    },
    {
      "id": 4161,
      "userDefinedId": "DCSC",
      "text": "Dry Clean, Short Cycle",
      "state": "active",
      "position": 2,
      "properties": [],
      "languages": []
    }
  ]
}
```

The response wraps the created instructions in the standard envelope. Hold onto each `id` —
styles reference care instructions by it when building care label output.

## Field reference

The fields that matter most when creating or updating a care instruction:

| Field           | What it means at Delogue                                                                                                                                 |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `isActive`      | Whether the instruction is active on creation. Defaults to true. Inactive instructions cannot be selected on styles.                                     |
| `languages`     | Initial per-language translations. Each entry pairs a languageId with its translated text. Null or omitted creates the instruction with no translations. |
| `text`          | Default display text of the care instruction. Required.                                                                                                  |
| `userDefinedId` | Customer-defined identifier for the care instruction. Must be unique within the organisation. Optional.                                                  |

## Roles & permissions

Managing the care instruction library requires the **`company`** permission on a **designer
(brand)** account — typically `CompanyAdmin`. The user also needs the **Care Instruction** role
assigned in Admin > Company info > Roles. Supplier accounts collaborate on styles but do not
manage a brand's care instruction library.

<Note>
  Multi-language translations require a **Professional licence** subscription. The `languages`
  field is accepted on all tiers but translation values are only surfaced where the feature is
  enabled.
</Note>

## When things go wrong

Errors use the standard envelope (`status: "error"`, a `code`, and `error.details[]`). See
[Errors & responses](/concepts/errors) for the full list of codes and how to resolve them.

Common cases:

* **409 Conflict** on `DELETE` — the instruction is still referenced by one or more styles.
  Deactivate it with `PUT /api/care-instructions/{id}` (`state: "Inactive"`) instead of
  deleting it, or remove it from all styles first.
* **400 validation\_error** — `text` is missing on create, or `state: "Deleted"` was passed to
  the single-update endpoint.
* **404 resource\_error** — the `id` does not exist or does not belong to your organisation.

## What to call next

<CardGroup cols={2}>
  <Card title="Colors" href="/guides/colors">
    Build the colour library that care instructions sit alongside on a style.
  </Card>

  <Card title="Seasons" href="/guides/seasons">
    Create the seasons that styles — and their care instructions — are filed under.
  </Card>

  <Card title="Style categories" href="/guides/style-categories">
    Organise styles by category before assigning care instructions.
  </Card>

  <Card title="Size ranges" href="/guides/size-ranges">
    Another style-level library entity: size ranges used alongside care labels.
  </Card>

  <Card title="Style care instructions" href="/guides/style-care-instructions">
    Read the care instructions assembled on a specific style.
  </Card>

  <Card title="Care instruction icons" href="/guides/care-instruction-icons">
    Browse the care-symbol icon library referenced by care instructions.
  </Card>
</CardGroup>
