---
title: "Run now, outside the schedule; works while paused [write]"
method: POST
path: "/routines/{id}/run"
---

# Run now, outside the schedule; works while paused \[write\]

`POST /routines/{id}/run`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/routines/{id}/run`
- Auth: HTTP bearer

With no body it is a manual run: trigger_context {type:"manual"}. With `input` or `idempotency_key` it is an API-triggered run: trigger_context {type:"api"}; the input is added to the run's first message under the label "Input for this run:", and a repeated idempotency_key on the same routine returns the first run instead of starting another. Neither emits routine_run webhooks.

## Path parameters

- `id` string, required

## Request body

- object
  - `input` string: What this run should work on, such as an event's payload
  - `idempotency_key` string: The caller's id for the event; a repeat returns the first run

## Response `201`

Created

- object
  - `run` RoutineRun, required: One fire attempt. Exactly one of session_id / error is non-null.
    - `id` string: rrun_… identifier
    - `routine_id` string
    - `trigger_context` object: {type:"schedule", scheduled_at} | {type:"manual"}
    - `session_id` string, nullable
    - `error` object, nullable: {type, message}. Types: agent_archived_error · agent_not_found_error · session_archived_error · session_not_found_error · session_busy_error · environment_archived_error · environment_not_found_error · vault_not_found_error · insufficient_credits_error · rate_limited_error · run_rejected_error · unknown_error. Unrecoverable types auto-pause the routine; transient ones (credits, rate limit, busy) leave it active for the next occurrence. precheck_unchanged is not a failure: the scheduled fire was skipped because the routine's precheck URL returned the same content as at the last run; no session started, the routine stays active and no routine_run webhook is sent.
    - `agent` object: Resolved agent reference at fire time
    - `created_at` string

## Other responses

- `default`: Error — { error: { code, message, request_id } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 5 info
  - added optional request body
  - added the optional property `error/request_id` to the response with the `default` status
  - the response property `error` became required for the status `default`
  - the response property `error/code` became required for the status `default`
  - …1 more

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/routines/:id/run/post.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/0d435187cd55?raw)
