# API Introduction

*Trigger service runs and read outcomes programmatically.*

> **Caution:** The Service API is in preview. Endpoints and auth are subject to change, and are not yet covered by the published OpenAPI spec.

Tredy's Service API lets you trigger runs, track their progress, and fetch
outcomes from your own systems. All routes are mounted under `/api`.

## Services

| Method | Path | Purpose |
|--------|------|---------|
| `GET` | `/api/services` | List services available to your org |
| `GET` | `/api/services/{serviceSlug}` | Get a service definition |
| `GET` | `/api/services/{serviceSlug}/intake` | Get the service's intake schema |

## Runs

| Method | Path | Purpose |
|--------|------|---------|
| `POST` | `/api/services/{serviceSlug}/runs` | Start a run |
| `POST` | `/api/services/{serviceSlug}/runs/bulk` | Start multiple runs |
| `GET` | `/api/services/{serviceSlug}/runs/{runUuid}` | Get a run |
| `GET` | `/api/services/{serviceSlug}/runs/{runUuid}/status` | Run status |
| `GET` | `/api/services/{serviceSlug}/runs/{runUuid}/events` | Run event stream |
| `POST` | `/api/services/{serviceSlug}/runs/{runUuid}/cancel` | Cancel a run |
| `POST` | `/api/services/{serviceSlug}/runs/{runUuid}/pause` | Pause a run |
| `POST` | `/api/services/{serviceSlug}/runs/{runUuid}/resume` | Resume a run |

## Human-in-the-loop

| Method | Path | Purpose |
|--------|------|---------|
| `GET` | `/api/services/{serviceSlug}/runs/{runUuid}/human-loop` | Pending decision |
| `POST` | `/api/services/{serviceSlug}/runs/{runUuid}/human-loop/answer` | Answer it |

## Outcomes

| Method | Path | Purpose |
|--------|------|---------|
| `GET` | `/api/services/{serviceSlug}/outcome-preview` | Preview the outcome |
| `GET` | `/api/services/{serviceSlug}/artifacts/{artifactId}/export` | Export an artifact |

> **Tip:** A separate legacy **Developer API** (documents, workspaces, system) is documented via OpenAPI under `/v1/*`. The Service API above is the current, service-oriented surface.
