# Agent: Loops

**Page:** api/agent/loops

[Download Raw Markdown](./api/agent/loops.md)

---

{/* AUTO-GENERATED — Do not edit manually. Regenerate with: npm run docs:api:generate */}



## Agent: Loops

Agent loops are scheduled, self-prompting recurrences attached to an agent session. Each loop fires a prompt on a configured interval with optional cost and wall-clock ceilings, and runs off a dedicated loop lane rather than the regular command channel. Use the endpoints on this page to list, create, immediately fire, update, or delete loops scoped to a single session. Per-request realm headers are rejected on these routes because loops are session-frozen; open a realm-scoped session instead.


All cURL examples below target the per-container agent host `https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu`. Replace `{projectId}`, `{containerId}`, and `{server}` with the values from your Hoody dashboard before sending requests.


---

### `GET /api/v1/agent/sessions/{id}/loops`

Lists the recurring loops scheduled for a session (`loops.list`). The response is the standard kit list envelope `{ items, meta: { total } }`, with optional `page` / `limit` pagination applied gateway-side (the underlying snapshot is session-scoped, so the page window is applied after the daemon returns).

#### Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | string | Yes | Session identifier. |
| `page` | query | integer | No | 1-based page number for pagination. |
| `limit` | query | integer | No | Maximum items per page (`0` = no pagination). |
| `X-Hoody-Cwd` | header | string | No | Per-request working-directory scope for the `.hoody` project layer / record cwd / tool+workflow cwd. |
| `X-Hoody-Config-Dir` | header | string | No | Per-request `--config-dir` override selecting which on-disk `.hoody` install a stateless read/write resolves. |
| `X-Hoody-Container` | header | string | No | Per-request bound remote container (omit for local). Rejected (400) on routes with no container dimension. |
| `X-Hoody-Realm` | header | string | No | Per-request realm selector: `"global"` or a 24-hex id (also accepted as `?realm=`). Rejected (400 `realm_scope_unsupported`) on active-only / no-realm routes. |
| `realm` | query | string | No | Query-string alias of the `X-Hoody-Realm` header (read only when the header is absent). Same accepted values and rejection rules. |

This endpoint takes no request body.

#### Response




```json
{
  "items": [
    {
      "loopId": "lp_8f3a1c9d",
      "prompt": "Summarize open pull requests",
      "interval": "30m",
      "maxRuns": 0,
      "paused": false,
      "maxCostUsd": 5,
      "maxWallMs": 0,
      "runCount": 14,
      "nextRunAt": "2026-03-04T14:30:00Z"
    },
    {
      "loopId": "lp_2b91e7f4",
      "prompt": "Review the changelog for upstream releases",
      "interval": "6h",
      "maxRuns": 0,
      "paused": true,
      "maxCostUsd": 0,
      "maxWallMs": 0,
      "runCount": 3,
      "nextRunAt": null
    }
  ],
  "meta": {
    "total": 2,
    "page": 1,
    "limit": 20
  }
}
```




```json
{
  "code": "bad_request",
  "message": "invalid request"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `bad_request` | Bad request | The request was malformed or carried invalid parameters. | Correct the request body or query parameters. |
| `realm_scope_unsupported` | Realm scope unsupported | A per-request realm header was supplied to an active-only / global-no-realm RPC, which has no realm dimension to scope. | Omit the realm header on this route, or open a session to scope by realm. |




```json
{
  "code": "forbidden",
  "message": "request must arrive through the Hoody proxy"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `forbidden` | Forbidden (not via the Hoody proxy) | The request did not reach the service through the public endpoint. | Reach the agent through `hoody-proxy` (e.g. `hoody agent …` → platform → proxy), not by connecting to the container directly. |




```json
{
  "code": "not_found",
  "message": "resource not found"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `not_found` | Not found | The requested resource does not exist. | Verify the path and identifier. |




```json
{
  "code": "rate_limited",
  "message": "request rate limit exceeded"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `rate_limited` | Too many requests | The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. | Honor the `Retry-After` header and retry; reduce the request rate. |




```json
{
  "code": "internal_error",
  "message": "internal server error"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `internal_error` | Internal error | An unexpected error occurred while handling the request. | Retry; if persistent, inspect the daemon logs. |




```json
{
  "code": "service_unavailable",
  "message": "service unavailable"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `service_unavailable` | Service unavailable | The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit). | Honor `Retry-After` and retry. |




#### SDK / cURL




```ts
// List loops on a session, paginated.
await client.agent.loops.listLoopsIterator(sessionId, { page: 1, limit: 20 });

// Or simply list all of them (limit=0 → no pagination).
await client.agent.loops.listLoopsIterator(sessionId);
```




```bash
curl -X GET "https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu/api/v1/agent/sessions/{id}/loops?page=1&limit=20" \
  -H "Accept: application/json"
```




---

### `POST /api/v1/agent/sessions/{id}/loops`

Creates a recurring loop on a session (`loops.create`). Configure the interval, an optional `stop_when` predicate, a run cap (`max_runs`), and optional cost / wall-clock ceilings. Loop fires use the dedicated loop lane, not the command channel.

#### Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | string | Yes | Session identifier. |
| `X-Hoody-Cwd` | header | string | No | Per-request working-directory scope for the `.hoody` project layer / record cwd / tool+workflow cwd. |
| `X-Hoody-Config-Dir` | header | string | No | Per-request `--config-dir` override selecting which on-disk `.hoody` install a stateless read/write resolves. |
| `X-Hoody-Container` | header | string | No | Per-request bound remote container (omit for local). Rejected (400) on routes with no container dimension. |
| `X-Hoody-Realm` | header | string | No | Per-request realm selector: `"global"` or a 24-hex id. Rejected (400 `realm_scope_unsupported`) on active-only / no-realm routes. |
| `realm` | query | string | No | Query-string alias of `X-Hoody-Realm` (read only when the header is absent). Same accepted values and rejection rules. |

#### Request Body

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `prompt` | string | Yes | The prompt fired each loop run. |
| `interval` | string | No | Run interval as a duration token, e.g. `"30m"`. |
| `max_runs` | integer | No | Stop after this many runs (`0` = unlimited). |
| `stop_when` | string | No | Optional stop predicate evaluated each run. |
| `max_cost_usd` | number | No | Cost ceiling (`0` = unlimited). |
| `max_wall_ms` | integer | No | Wall-clock ceiling in ms (`0` = unlimited). |

```json
{
  "prompt": "Summarize the last 24 hours of GitHub issues and post a digest",
  "interval": "30m",
  "max_runs": 0,
  "stop_when": "all_issues_acknowledged",
  "max_cost_usd": 5,
  "max_wall_ms": 120000
}
```

#### Response




```json
{
  "loopId": "lp_8f3a1c9d",
  "sessionId": "sess_4d8e2a1b",
  "prompt": "Summarize the last 24 hours of GitHub issues and post a digest",
  "interval": "30m",
  "maxRuns": 0,
  "stopWhen": "all_issues_acknowledged",
  "maxCostUsd": 5,
  "maxWallMs": 120000,
  "paused": false,
  "runCount": 0,
  "nextRunAt": "2026-03-04T14:00:00Z"
}
```




```json
{
  "code": "bad_request",
  "message": "invalid request"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `bad_request` | Bad request | The request was malformed or carried invalid parameters. | Correct the request body or query parameters. |
| `realm_scope_unsupported` | Realm scope unsupported | A per-request realm header was supplied to an active-only / global-no-realm RPC. | Omit the realm header on this route, or open a session to scope by realm. |




```json
{
  "code": "forbidden",
  "message": "request must arrive through the Hoody proxy"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `forbidden` | Forbidden (not via the Hoody proxy) | The request did not reach the service through the public endpoint. | Reach the agent through `hoody-proxy` (e.g. `hoody agent …` → platform → proxy), not by connecting to the container directly. |




```json
{
  "code": "not_found",
  "message": "resource not found"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `not_found` | Not found | The requested resource does not exist. | Verify the path and identifier. |




```json
{
  "code": "payload_too_large",
  "message": "request body exceeds the configured size limit"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `payload_too_large` | Payload too large | The request body exceeds the configured size cap (`MaxBodyBytes`). The gateway rejects an oversized body at the edge (`http.MaxBytesReader`) before the handler reads it. | Reduce the request body below the configured limit (default 8 MiB); split a large payload into smaller requests. |




```json
{
  "code": "rate_limited",
  "message": "request rate limit exceeded"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `rate_limited` | Too many requests | The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. | Honor the `Retry-After` header and retry; reduce the request rate. |




```json
{
  "code": "internal_error",
  "message": "internal server error"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `internal_error` | Internal error | An unexpected error occurred while handling the request. | Retry; if persistent, inspect the daemon logs. |




```json
{
  "code": "service_unavailable",
  "message": "service unavailable"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `service_unavailable` | Service unavailable | The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit). | Honor `Retry-After` and retry. |




#### SDK / cURL




```ts
await client.agent.loops.createLoop(sessionId, {
  prompt: "Summarize the last 24 hours of GitHub issues and post a digest",
  interval: "30m",
  max_runs: 0,
  stop_when: "all_issues_acknowledged",
  max_cost_usd: 5,
  max_wall_ms: 120000
});
```




```bash
curl -X POST "https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu/api/v1/agent/sessions/{id}/loops" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "prompt": "Summarize the last 24 hours of GitHub issues and post a digest",
    "interval": "30m",
    "max_runs": 0,
    "stop_when": "all_issues_acknowledged",
    "max_cost_usd": 5,
    "max_wall_ms": 120000
  }'
```




---

### `POST /api/v1/agent/sessions/{id}/loops/{loopId}/run-now`

Fires a loop's next run immediately (`loops.run_now`) on the dedicated loop lane. The session id and loop id come from the path; the body is optional and forwarded to the daemon as-is (reserved `_`-prefixed keys are ignored, and the per-request cwd / config-dir scope is applied automatically).

#### Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | string | Yes | Session identifier. |
| `loopId` | path | string | Yes | Loop identifier. |
| `X-Hoody-Cwd` | header | string | No | Per-request working-directory scope for the `.hoody` project layer / record cwd / tool+workflow cwd. |
| `X-Hoody-Config-Dir` | header | string | No | Per-request `--config-dir` override selecting which on-disk `.hoody` install a stateless read/write resolves. |
| `X-Hoody-Container` | header | string | No | Per-request bound remote container (omit for local). Rejected (400) on routes with no container dimension. |
| `X-Hoody-Realm` | header | string | No | Per-request realm selector: `"global"` or a 24-hex id. Rejected (400 `realm_scope_unsupported`) on active-only / no-realm routes. |
| `realm` | query | string | No | Query-string alias of `X-Hoody-Realm` (read only when the header is absent). Same accepted values and rejection rules. |

#### Request Body

This endpoint accepts an optional JSON object. No specific fields are defined — any non-reserved keys are forwarded to the daemon `loops.run_now` RPC as pass-through.

#### Response




```json
{
  "loopId": "lp_8f3a1c9d",
  "sessionId": "sess_4d8e2a1b",
  "fired": true,
  "runId": "run_0192c1f4",
  "scheduledAt": "2026-03-04T13:47:22Z"
}
```




```json
{
  "code": "bad_request",
  "message": "invalid request"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `bad_request` | Bad request | The request was malformed or carried invalid parameters. | Correct the request body or query parameters. |
| `realm_scope_unsupported` | Realm scope unsupported | A per-request realm header was supplied to an active-only / global-no-realm RPC. | Omit the realm header on this route, or open a session to scope by realm. |




```json
{
  "code": "forbidden",
  "message": "request must arrive through the Hoody proxy"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `forbidden` | Forbidden (not via the Hoody proxy) | The request did not reach the service through the public endpoint. | Reach the agent through `hoody-proxy` (e.g. `hoody agent …` → platform → proxy), not by connecting to the container directly. |




```json
{
  "code": "not_found",
  "message": "resource not found"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `not_found` | Not found | The requested resource does not exist. | Verify the path and identifier. |




```json
{
  "code": "payload_too_large",
  "message": "request body exceeds the configured size limit"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `payload_too_large` | Payload too large | The request body exceeds the configured size cap (`MaxBodyBytes`). The gateway rejects an oversized body at the edge (`http.MaxBytesReader`) before the handler reads it. | Reduce the request body below the configured limit (default 8 MiB); split a large payload into smaller requests. |




```json
{
  "code": "rate_limited",
  "message": "request rate limit exceeded"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `rate_limited` | Too many requests | The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. | Honor the `Retry-After` header and retry; reduce the request rate. |




```json
{
  "code": "internal_error",
  "message": "internal server error"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `internal_error` | Internal error | An unexpected error occurred while handling the request. | Retry; if persistent, inspect the daemon logs. |




```json
{
  "code": "service_unavailable",
  "message": "service unavailable"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `service_unavailable` | Service unavailable | The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit). | Honor `Retry-After` and retry. |




#### SDK / cURL




```ts
// Fire the loop immediately with no extra body fields.
await client.agent.loops.runLoopNow(sessionId, loopId);

// Or pass a body if the daemon accepts one.
await client.agent.loops.runLoopNow(sessionId, loopId, { /* extra body */ });
```




```bash
curl -X POST "https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu/api/v1/agent/sessions/{id}/loops/{loopId}/run-now" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{}'
```




---

### `PATCH /api/v1/agent/sessions/{id}/loops/{loopId}`

Updates a loop by body shape. Set exactly one intent per request — the server dispatches to one of three underlying RPCs and rejects requests that mix intents with `400`:

- Run state (`paused`) — dispatches `loops.set_state` (`true` pauses, `false` resumes).
- Expiry (`expires_in`) — dispatches `loops.set_expiry` (duration-from-now token, e.g. `"2h"`; `""` or `"never"` clears).
- Budget (`max_cost_usd` and/or `max_wall_ms`) — dispatches `loops.update` to set / revive the cost and wall-clock ceilings only. `interval` and `prompt` are not changeable in v1.


Mixing two or more of the intents above (`paused`, `expires_in`, `max_cost_usd`, `max_wall_ms`) results in a `400 bad_request` rather than silently applying one and dropping the others.


#### Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | string | Yes | Session identifier. |
| `loopId` | path | string | Yes | Loop identifier. |
| `X-Hoody-Cwd` | header | string | No | Per-request working-directory scope for the `.hoody` project layer / record cwd / tool+workflow cwd. |
| `X-Hoody-Config-Dir` | header | string | No | Per-request `--config-dir` override selecting which on-disk `.hoody` install a stateless read/write resolves. |
| `X-Hoody-Container` | header | string | No | Per-request bound remote container (omit for local). Rejected (400) on routes with no container dimension. |
| `X-Hoody-Realm` | header | string | No | Per-request realm selector: `"global"` or a 24-hex id. Rejected (400 `realm_scope_unsupported`) on active-only / no-realm routes. |
| `realm` | query | string | No | Query-string alias of `X-Hoody-Realm` (read only when the header is absent). Same accepted values and rejection rules. |

#### Request Body

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `paused` | boolean | No | Run-state intent (`loops.set_state`): `true` pauses, `false` resumes. |
| `expires_in` | string | No | Expiry intent (`loops.set_expiry`): duration-from-now token, e.g. `"2h"`. `""` or `"never"` clears. |
| `max_cost_usd` | number | No | Budget intent (`loops.update`): cost ceiling (`0` = unlimited). |
| `max_wall_ms` | integer | No | Budget intent (`loops.update`): wall-clock ceiling in ms, or a duration token (`0` = unlimited). |

```json
{
  "paused": true
}
```

#### Response




```json
{
  "loopId": "lp_8f3a1c9d",
  "sessionId": "sess_4d8e2a1b",
  "paused": true,
  "expiresIn": "30m",
  "maxCostUsd": 5,
  "maxWallMs": 120000,
  "intent": "set_state"
}
```




```json
{
  "code": "bad_request",
  "message": "exactly one update intent required"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `bad_request` | Bad request | The request was malformed or carried invalid parameters (including mixing more than one update intent). | Correct the request body or query parameters; send only one of `paused`, `expires_in`, `max_cost_usd`, `max_wall_ms`. |
| `realm_scope_unsupported` | Realm scope unsupported | A per-request realm header was supplied to an active-only / global-no-realm RPC. | Omit the realm header on this route, or open a session to scope by realm. |




```json
{
  "code": "forbidden",
  "message": "request must arrive through the Hoody proxy"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `forbidden` | Forbidden (not via the Hoody proxy) | The request did not reach the service through the public endpoint. | Reach the agent through `hoody-proxy` (e.g. `hoody agent …` → platform → proxy), not by connecting to the container directly. |




```json
{
  "code": "not_found",
  "message": "resource not found"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `not_found` | Not found | The requested resource does not exist. | Verify the path and identifier. |




```json
{
  "code": "payload_too_large",
  "message": "request body exceeds the configured size limit"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `payload_too_large` | Payload too large | The request body exceeds the configured size cap (`MaxBodyBytes`). The gateway rejects an oversized body at the edge (`http.MaxBytesReader`) before the handler reads it. | Reduce the request body below the configured limit (default 8 MiB); split a large payload into smaller requests. |




```json
{
  "code": "rate_limited",
  "message": "request rate limit exceeded"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `rate_limited` | Too many requests | The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. | Honor the `Retry-After` header and retry; reduce the request rate. |




```json
{
  "code": "internal_error",
  "message": "internal server error"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `internal_error` | Internal error | An unexpected error occurred while handling the request. | Retry; if persistent, inspect the daemon logs. |




```json
{
  "code": "service_unavailable",
  "message": "service unavailable"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `service_unavailable` | Service unavailable | The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit). | Honor `Retry-After` and retry. |




#### SDK / cURL




```ts
// Pause the loop (run-state intent).
await client.agent.loops.updateLoop(sessionId, loopId, { paused: true });

// Set / clear an expiry (expiry intent).
await client.agent.loops.updateLoop(sessionId, loopId, { expires_in: "2h" });

// Revive / change the cost and wall-clock budgets (budget intent).
await client.agent.loops.updateLoop(sessionId, loopId, {
  max_cost_usd: 10,
  max_wall_ms: 300000
});
```




```bash
curl -X PATCH "https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu/api/v1/agent/sessions/{id}/loops/{loopId}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{ "paused": true }'
```




---

### `DELETE /api/v1/agent/sessions/{id}/loops/{loopId}`

Deletes a recurring loop from a session (`loops.delete`). The session id and loop id come from the path; the body is optional and forwarded to the daemon as-is (reserved `_`-prefixed keys are ignored, and the per-request cwd / config-dir scope is applied automatically).

#### Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | string | Yes | Session identifier. |
| `loopId` | path | string | Yes | Loop identifier. |
| `X-Hoody-Cwd` | header | string | No | Per-request working-directory scope for the `.hoody` project layer / record cwd / tool+workflow cwd. |
| `X-Hoody-Config-Dir` | header | string | No | Per-request `--config-dir` override selecting which on-disk `.hoody` install a stateless read/write resolves. |
| `X-Hoody-Container` | header | string | No | Per-request bound remote container (omit for local). Rejected (400) on routes with no container dimension. |
| `X-Hoody-Realm` | header | string | No | Per-request realm selector: `"global"` or a 24-hex id. Rejected (400 `realm_scope_unsupported`) on active-only / no-realm routes. |
| `realm` | query | string | No | Query-string alias of `X-Hoody-Realm` (read only when the header is absent). Same accepted values and rejection rules. |

#### Request Body

This endpoint accepts an optional JSON object. No specific fields are defined — any non-reserved keys are forwarded to the daemon `loops.delete` RPC as pass-through.

#### Response




```json
{
  "loopId": "lp_8f3a1c9d",
  "sessionId": "sess_4d8e2a1b",
  "deleted": true
}
```




```json
{
  "code": "bad_request",
  "message": "invalid request"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `bad_request` | Bad request | The request was malformed or carried invalid parameters. | Correct the request body or query parameters. |
| `realm_scope_unsupported` | Realm scope unsupported | A per-request realm header was supplied to an active-only / global-no-realm RPC. | Omit the realm header on this route, or open a session to scope by realm. |




```json
{
  "code": "forbidden",
  "message": "request must arrive through the Hoody proxy"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `forbidden` | Forbidden (not via the Hoody proxy) | The request did not reach the service through the public endpoint. | Reach the agent through `hoody-proxy` (e.g. `hoody agent …` → platform → proxy), not by connecting to the container directly. |




```json
{
  "code": "not_found",
  "message": "resource not found"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `not_found` | Not found | The requested resource does not exist. | Verify the path and identifier. |




```json
{
  "code": "rate_limited",
  "message": "request rate limit exceeded"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `rate_limited` | Too many requests | The per-client request rate limit was exceeded; the gateway throttled the request before dispatch. | Honor the `Retry-After` header and retry; reduce the request rate. |




```json
{
  "code": "internal_error",
  "message": "internal server error"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `internal_error` | Internal error | An unexpected error occurred while handling the request. | Retry; if persistent, inspect the daemon logs. |




```json
{
  "code": "service_unavailable",
  "message": "service unavailable"
}
```

| Error Code | Title | Description | Resolution |
|------------|-------|-------------|------------|
| `service_unavailable` | Service unavailable | The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit). | Honor `Retry-After` and retry. |




#### SDK / cURL




```ts
// Delete with no extra body fields.
await client.agent.loops.deleteLoop(sessionId, loopId);

// Or pass a body if the daemon accepts one.
await client.agent.loops.deleteLoop(sessionId, loopId, { /* extra body */ });
```




```bash
curl -X DELETE "https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.icu/api/v1/agent/sessions/{id}/loops/{loopId}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{}'
```