# Loops

> The Loops operations of the Hub REST API (1 operation).

URL: https://docs.synap.live/docs/reference/hub-api/loops · Generated from Synap-core/backend@c31e261ab (main)

Paths are relative to `/api/hub` on a pod.

## POST /loops/apply

Apply a loop (autonomy) template

Instantiates an autonomy loop ({playbooks · triggers}) from a config descriptor (inline `definition` or a seed `templateKey`) + `params`. `{{param}}` placeholders are interpolated; each playbook/trigger is created through the governed routers (proposal-gated — proposal ids are surfaced in `proposals`). A playbook's inline `schedule` materializes its backing cron automation for free. Requires hub-protocol.write scope.

Request body (`application/json`): object

| Field | Type | Required | Description |
|---|---|---|---|
| `definition` | object |  |  |
| `templateKey` | string |  |  |
| `params` | object |  |  |
| `workspaceId` | string |  |  |

Responses:

- `200`: Applied loop (created + proposed resources)
- `400`: Bad request
- `403`: Forbidden
- `404`: Template not found
- `500`: Internal error
