---
title: "Trigger a routine"
method: POST
path: "/v1/routines/{slug}/trigger"
tags: ["Routines"]
---

# Trigger a routine

`POST /v1/routines/{slug}/trigger`

## Request

- Base URL: `https://api.dotfile.com`
- URL: `https://api.dotfile.com/v1/routines/{slug}/trigger`
- Auth: API key in header `X-DOTFILE-API-KEY`

Starts an execution of a routine defined in your Dotfile workspace. The agent runs the routine prompt autonomously; the call returns as soon as the execution is enqueued, and the outcome is reported through the autonomy run webhooks.  
Only routines carrying an `external_api` trigger can be fired here — a routine without one or a disabled routine is refused with a `409`. Scope the execution to a case with `case_id`, or leave it out to run across the whole workspace.

## Path parameters

- `slug` string, required

## Request body

- TriggerRoutine
  - `case_id` string, uuid: Case to scope the execution to. When omitted, the routine runs across the whole workspace.

## Response `201`

The execution started

**ℹ️ Click to see full payload**

- RoutineTriggered
  - `thread_id` string, uuid, required: Identifier of the execution. Carried by the autonomy run webhooks reporting the outcome.

## Other responses

- `400`: The request is either malformed or contain invalid parameters. - Make sure the body payload matches the expected schema
- `404`: No routine can be found.
- `409`: The routine cannot be triggered because it is disabled or carries no external API trigger.

## Changes

- **2026-11-03** `50cab516e856`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/dotfile/apis/api-specifications/changes/v1/routines/:slug/trigger/post.md)

---

[API](https://skmtc.dev/dotfile/apis/api-specifications.md) - [All operations](https://skmtc.dev/dotfile/apis/api-specifications/llms.txt) - [OpenAPI document](https://skmtc.dev/dotfile/apis/api-specifications/revisions/50cab516e856?raw)
