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

# Update Custom Instruction

> Update an existing custom translation instruction

Update any combination of fields on a custom instruction. Send only the properties you want to change.

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH "https://api-integration.ollang.com/integration/custom-instructions/507f1f77bcf86cd799439011" \
    -H "X-Api-Key: <your-api-key>" \
    -H "Content-Type: application/json" \
    -d '{
      "value": "Use informal tone for marketing copy only.",
      "active": true
    }'
  ```

  ```javascript JavaScript theme={null}
  const instructionId = "507f1f77bcf86cd799439011";

  const response = await fetch(
    `https://api-integration.ollang.com/integration/custom-instructions/${instructionId}`,
    {
      method: "PATCH",
      headers: {
        "X-Api-Key": "<your-api-key>",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        value: "Use informal tone for marketing copy only.",
        active: true,
      }),
    }
  );

  const updated = await response.json();
  ```

  ```python Python theme={null}
  import requests

  instruction_id = "507f1f77bcf86cd799439011"

  data = {
      "value": "Use informal tone for marketing copy only.",
      "active": True,
  }

  headers = {
      "X-Api-Key": "<your-api-key>",
      "Content-Type": "application/json",
  }

  response = requests.patch(
      f"https://api-integration.ollang.com/integration/custom-instructions/{instruction_id}",
      headers=headers,
      json=data,
  )

  updated = response.json()
  ```
</RequestExample>

## Authorizations

This endpoint requires API key authentication.

* **Header name**: `X-Api-Key`
* **Header value**: Your API key from the [Ollang dashboard](https://lab.ollang.com)

## Path Parameters

<ParamField path="instructionId" type="string" required>
  The custom instruction’s unique identifier (from [List Custom Instructions](/apis/ollang-api-reference/list-custom-instructions) or create response).
</ParamField>

## Body Parameters

All fields are optional; include at least one.

<ParamField body="key" type="string">
  New machine-friendly name for the instruction.
</ParamField>

<ParamField body="value" type="string">
  New instruction text.
</ParamField>

<ParamField body="active" type="boolean">
  Enable or disable this instruction without deleting it.
</ParamField>

<ParamField body="description" type="string">
  Updated description.
</ParamField>

## Response

Returns the updated custom instruction object (same shape as [List Custom Instructions](/apis/ollang-api-reference/list-custom-instructions)).

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "507f1f77bcf86cd799439011",
    "key": "tone_and_register",
    "value": "Use informal tone for marketing copy only.",
    "active": true,
    "description": "Instructions for maintaining appropriate tone and register",
    "scopeRefId": "507f1f77bcf86cd799439012",
    "createdAt": "2023-10-05T12:34:56.789Z",
    "updatedAt": "2023-10-06T09:15:00.000Z"
  }
  ```

  ```json 404 theme={null}
  {
    "statusCode": 404,
    "message": "Custom instruction not found"
  }
  ```

  ```json 401 theme={null}
  {
    "error": "Unauthorized",
    "message": "Invalid or missing API key"
  }
  ```
</ResponseExample>
