---
title: "Dispatch an agent cue to a session or send a command cue to a scoped shell terminal"
method: POST
path: "/api/v1/cues/{cueId}/invoke"
tags: ["cues"]
---

# Dispatch an agent cue to a session or send a command cue to a scoped shell terminal

`POST /api/v1/cues/{cueId}/invoke`

## Request

- Base URL: `http://127.0.0.1:3001`
- URL: `http://127.0.0.1:3001/api/v1/cues/{cueId}/invoke`
- Auth: none declared

## Path parameters

- `cueId` string, required: Cue identifier.

## Request body

- InvokeCueRequest
  - `sessionId` string: Optional exact session target. Agent cues message it; command cues use its worktree. Omit it to spawn an agent worker or run a command in the project root. A supplied id must be non-blank and compatible, and never falls back to a replacement worker. Invocation body limit: 4 KiB.
  - `shell` string: Desktop shell selection used only for command cues.

## Response `200`

OK

- InvokeCueResponse
  - `kind` 'agent' | 'command', required: Invocation kind.
  - `sessionId` string: For agent cues, the session that received the prompt or newly spawned worker.
  - `shellTerminal` ShellTerminalResponse
    - `createdAt` string, date-time, required
    - `handleId` string, required
    - `projectId` string
    - `sessionId` string
    - `title` string, required
    - `workingDir` string, required

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `413`: Request Entity Too Large
- `500`: Internal Server Error
- `501`: Not Implemented

## Changes

- **2026-10-21** `8f160e6183cd`: 7 info
  - removed the `agent_switch_saga` enum value from the `reporting_owner` response property for the response status `400`
  - removed the `agent_switch_saga` enum value from the `reporting_owner` response property for the response status `403`
  - removed the `agent_switch_saga` enum value from the `reporting_owner` response property for the response status `404`
  - removed the `agent_switch_saga` enum value from the `reporting_owner` response property for the response status `409`
  - …3 more
- **2026-09-30** `fce4d8e71c06`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/changes/api/v1/cues/:cueId/invoke/post.md)

---

[API](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon.md) - [All operations](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/llms.txt) - [OpenAPI document](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/revisions/3a5588b32f85?raw)
