---
# @generated by sylphx-gen. Do not edit.
title: "Control a goal"
description: "`agents.goals.control` (POST /v1/{name}:control): Applies an explicit owner control to this exact Goal/version."
type: reference
product: agents
summary: "Applies an explicit owner control to this exact Goal/version."
updated: 2026-09-28
nav: false
---

Applies an explicit owner control to this exact Goal/version. Pause interrupts only its current execution; resume does not resolve a wait or clear observed usage. Amend changes only supplied objective/budget fields.

- **Path** `POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/agent_sessions/agent-session/goals/goal:control`
- **Scope** `agents:sessions`
- **Effect** `write` — a successful call changes state.
- **Collection** [goals](/docs/api/goals)

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The exact Goal name; never a lookup of a Session's newest Goal. Required. |
| `expected_version` | `int32` | The contract version observed by the owner. Required. |
| `action` | `GoalControlAction` | Explicit owner action. Only AMEND accepts objective/budget changes. Required. One of `pause`, `resume`, `amend`. |
| `operation_id` | `string` | Caller-stable mutation identity, nonempty and at most 128 bytes. Required. |
| `objective` | `string` | New objective, only when amending. Omission preserves the existing text. |
| `token_budget` | `int64` | New explicit token budget, only when amending. Omission preserves it. |
| `clear_token_budget` | `bool` | Explicitly remove a budget when amending; incompatible with token_budget. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The exact Session-owned Goal name. |
| `uid` | `string` | The platform Resource UID; the conserved Goal UUID is its name's final id. Output only. |
| `meta` | `ResourceMeta` | Standard resource metadata. Output only. |
| `objective` | `string` | The objective, nonempty and at most 4,000 characters. Required. |
| `token_budget` | `int64` | Omit unless the caller explicitly requests a positive token budget. |
| `state` | `GoalState` | Lifecycle; an execution hold is represented separately. Output only. One of `working`, `waiting`, `completed`, `failed`. |
| `version` | `int32` | Optimistic acceptance-contract version, starting at one. Output only. |
| `tokens_used` | `int64` | Observed tokens charged exactly once per runtime step. Output only. |
| `usage_unavailable` | `bool` | Unknown usage holds execution when a token budget is enforced. Output only. |
| `owner_paused` | `bool` | Explicit owner pause; an unfinished Goal stays unfinished. Output only. |
| `impasse` | `bool` | Execution held after the required repeated observation of an impasse. Output only. |
| `receipt` | `SessionGoalReceipt` | The terminal observation, retained after another Goal becomes active. Output only. |
| `create_time` | `timestamp` | When this Goal was created. Output only. |
| `update_time` | `timestamp` | When this Goal last changed. Output only. |

### ResourceMeta

| Field | Type | What it is |
| --- | --- | --- |
| `generation` | `int64` | Increases by one on every change to `spec`. Output only. |
| `etag` | `string` | Strong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as `If-Match` or `etag` to make Update and Delete conditional; a mismatch fails with ABORTED / 409 `ETAG_MISMATCH`. Output only. |
| `create_time` | `timestamp` | When the Resource was created. Output only. |
| `update_time` | `timestamp` | When the Resource last changed. Output only. |
| `delete_time` | `timestamp` | Set while the Resource is being deleted. Output only. |
| `labels` | `map<string, string>` | Caller-writable, indexed labels (AIP-122 label rules). |
| `annotations` | `map<string, string>` | Caller-writable, unindexed annotations. |
| `display_name` | `string` | Caller-writable human-readable name. |
| `creator` | `string` | The principal that created the Resource. Output only. |

### SessionGoalReceipt

| Field | Type | What it is |
| --- | --- | --- |
| `stage` | `string` | The observed delivery stage. Required. |
| `target` | `string` | The concrete surface or artifact observed. Required. |
| `evidence` | `struct` | Nonempty structured evidence from that surface. Required. |

## Errors

- [`UNAUTHENTICATED`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`RESOURCE_NOT_FOUND`](/docs/api/errors/RESOURCE_NOT_FOUND) — The named Resource does not exist or is not visible.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`INVALID_STATE`](/docs/api/errors/INVALID_STATE) — The Resource is in a state that forbids the call.
- [`IDEMPOTENCY_KEY_REUSED`](/docs/api/errors/IDEMPOTENCY_KEY_REUSED) — An Idempotency-Key was reused with another body.
- [`IDEMPOTENCY_IN_PROGRESS`](/docs/api/errors/IDEMPOTENCY_IN_PROGRESS) — The first call with this Idempotency-Key is still running.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/agent_sessions/agent-session/goals/goal:control" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action":"pause","expected_version":1,"operation_id":"…"}'
```

**TypeScript**

```ts
const response = await sylphx.agents.goals.control({ action: 'pause', expectedVersion: 1, name: 'orgs/acme/projects/shop/envs/production/agent_sessions/agent-session/goals/goal', operationId: '…' })
```

**Rust**

```rust
let mut req = sylphx::agents::ControlAgentSessionGoalRequest::default();
req.action = sylphx::agents::GoalControlAction::Pause;
req.expected_version = 1;
req.name = "orgs/acme/projects/shop/envs/production/agent_sessions/agent-session/goals/goal".to_string();
req.operation_id = "…".to_string();
let response = sx.agents().goals().control(req).await?;
```

**CLI**

```bash
sylphx agents goals control orgs/acme/projects/shop/envs/production/agent_sessions/agent-session/goals/goal
```

**MCP**

```json
{ "method_id": "agents.goals.control", "args": {"action":"pause","expected_version":1,"name":"orgs/acme/projects/shop/envs/production/agent_sessions/agent-session/goals/goal","operation_id":"…"} }
```
