---
title: "Update chat goal"
method: PATCH
path: "/v1/replica/{id}/chats/{chat_id}/goal"
tags: ["Chats"]
---

# Update chat goal

`PATCH /v1/replica/{id}/chats/{chat_id}/goal`

## Request

- Base URL: `https://api.replicas.dev`
- URL: `https://api.replicas.dev/v1/replica/{id}/chats/{chat_id}/goal`
- Auth: HTTP bearer

Sets the objective of a Codex chat, or pauses and resumes it. Other agents return `goal: null`; give them a goal by sending a message with `goal_mode: true`. The replica must be active.

## Path parameters

- `id` string, uuid, required
- `chat_id` string, required

## Headers

- `X-Replicas-Api-Version` '2026-10-07'

## Request body

- object
  - `objective` string
  - `status` 'active' | 'paused'

## Response `200`

Updated goal

- object
  - `goal` ChatGoal
    - `objective` string
    - `status` 'active' | 'paused' | 'blocked' | 'usageLimited' | 'budgetLimited' | 'complete'
    - `token_budget` integer, nullable
    - `tokens_used` integer
    - `time_used_seconds` integer

## Other responses

- `401`: Unauthorized - Invalid or missing API key
- `404`: Resource not found
- `409`: Conflict - Resource already exists or operation conflicts with current state
- `500`: Internal server error

---

[API](https://skmtc.dev/replicas/apis/replicas-api.md) - [All operations](https://skmtc.dev/replicas/apis/replicas-api/llms.txt) - [OpenAPI document](https://skmtc.dev/replicas/apis/replicas-api/revisions/2703ac1c9cb7?raw)
