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

# Set Prompt

<span class="badge--patch">PATCH</span> <code class="endpoint-url">/workflows/:id/prompt</code>

Replace an agent's base (global) prompt — what it says, who it qualifies, and the goal it works toward. This is the editable prompt surfaced in the dashboard's agent editor.

For a per-channel override on top of this base prompt, see [Set Channel Prompts](/docs/en/api/workflows/set-channel-prompts).

## Path Parameters

| Parameter | Type          | Required | Description |
| --------- | ------------- | -------- | ----------- |
| `id`      | string (uuid) | **Yes**  | Agent ID    |

## Request Body

| Field           | Type   | Required | Description                                |
| --------------- | ------ | -------- | ------------------------------------------ |
| `global_prompt` | string | **Yes**  | The new base prompt. Max 50,000 characters |

## Responses

### `200` — Prompt updated

```json theme={null}
{
  "success": true,
  "workflow_id": "123e4567-e89b-12d3-a456-426614174000",
  "prompt_length": 1240
}
```

### `400` — Validation error

```json theme={null}
{
  "error": "Invalid input",
  "message": "global_prompt is required"
}
```

Also returned if `global_prompt` exceeds 50,000 characters.

### `401` — Authentication error

See [Authentication](/docs/en/api/authentication).

### `404` — Not found

```json theme={null}
{
  "error": "Not found",
  "message": "Workflow not found"
}
```

### `500` — Internal server error
