---
title: "Update an agent instruction"
method: PATCH
path: "/agentInstruction/{instruction_id}"
tags: ["AgentInstruction"]
---

# Update an agent instruction

`PATCH /agentInstruction/{instruction_id}`

Updates an existing agent instruction

## Path parameters

- `instruction_id` string, required

## Headers

- `If-Match` string

## Request body

- AgentInstruction — A user-defined instruction that tailors agent behavior for a workspace
  - `instruction_id` string — Unique identifier for the instruction
  - `workspace_id` string — The workspace this instruction belongs to
  - `name` string — A short name or title for the instruction
  - `instruction_text` string — The instruction itself (plain text)
  - `disabled` boolean — Whether the instruction is disabled. Disabled instructions are not injected into agent prompts.
  - `capabilities` AgentInstructionCapability[] — Capabilities this instruction applies to
  - `test_types` TestTypeEnum[] — Test types this instruction applies to
  - `environment_ids` string[] — Environment IDs this instruction applies to
  - `application_ids` string[] — Application IDs this instruction applies to
  - `created_by_id` string — The user who created this instruction
  - `created_time` integer — Creation timestamp in epoch milliseconds
  - `last_updated_by_id` string — The user who last updated this instruction
  - `last_updated_time` integer — Last update timestamp in epoch milliseconds

## Response `200`

The updated agent instruction

- AgentInstruction — A user-defined instruction that tailors agent behavior for a workspace
  - `instruction_id` string — Unique identifier for the instruction
  - `workspace_id` string — The workspace this instruction belongs to
  - `name` string — A short name or title for the instruction
  - `instruction_text` string — The instruction itself (plain text)
  - `disabled` boolean — Whether the instruction is disabled. Disabled instructions are not injected into agent prompts.
  - `capabilities` AgentInstructionCapability[] — Capabilities this instruction applies to
  - `test_types` TestTypeEnum[] — Test types this instruction applies to
  - `environment_ids` string[] — Environment IDs this instruction applies to
  - `application_ids` string[] — Application IDs this instruction applies to
  - `created_by_id` string — The user who created this instruction
  - `created_time` integer — Creation timestamp in epoch milliseconds
  - `last_updated_by_id` string — The user who last updated this instruction
  - `last_updated_time` integer — Last update timestamp in epoch milliseconds

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `404` — Entity not found
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
