---
title: "Execute an agent"
method: POST
path: "/execute"
tags: ["Agents"]
---

# Execute an agent

`POST /execute`

Triggers execution of a Station agent with the given task.
Returns immediately with a run ID that can be used to poll for status.

## Request body

- ExecuteRequest
  - `agent_name` string — Name of the agent to execute (mutually exclusive with agent_id)
  - `agent_id` integer — ID of the agent to execute (mutually exclusive with agent_name)
  - `task` string, required — The task/prompt to send to the agent
  - `variables` object — Optional variables to pass to the agent

## Response `200`

Agent execution started

- ExecuteResponse
  - `run_id` integer, required — Unique identifier for this execution run
  - `agent_id` integer, required
  - `agent_name` string, required
  - `status` 'running' | 'completed' | 'failed', required
  - `message` string, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Agent not found
- `503` — Webhook endpoint disabled

---

[API](https://skmtc.dev/cloudshipai/apis/station-dynamic-agent-mcp-api.md) · [All operations](https://skmtc.dev/cloudshipai/apis/station-dynamic-agent-mcp-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cloudshipai/station-dynamic-agent-mcp-api/revisions/ebdd92944c61/schema)
