---
title: "Query agent instructions"
method: GET
path: "/agentInstruction"
tags: ["AgentInstruction"]
---

# Query agent instructions

`GET /agentInstruction`

Query agent instructions for a workspace with optional filters

## Query parameters

- `workspace_id` string, required
- `capability` 'authoring' | 'recovery' | 'results_analysis' — Capability that an agent instruction applies to
- `application_id` string
- `environment_id` string
- `test_type` 'api' | 'browser' | 'performance' | 'mobile' — Type of test
- `limit` integer
- `cursor` string

## Response `200`

The query results

- AgentInstructionQueryResult — Paginated query result for agent instructions
  - `agent_instructions` AgentInstruction[]
    - `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
  - `cursor` string — Cursor for fetching the next page of results

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `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)
