---
title: "Write a resumable checkpoint"
method: POST
path: "/api/agent/sessions/{id}/checkpoint"
tags: ["Agent"]
---

# Write a resumable checkpoint

`POST /api/agent/sessions/{id}/checkpoint`

## Request

- Base URL: `http://localhost:38200`
- URL: `http://localhost:38200/api/agent/sessions/{id}/checkpoint`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `token`

## Path parameters

- `id` integer, required

## Request body

- object
  - `state` object
  - `summary` string
  - `token_estimate` integer

## Response `201`

Created checkpoint.

- AgentCheckpoint: The `agent_checkpoints` row — a resumable working-state snapshot. `seq` is monotonic per session.
  - `id` integer
  - `tenantId` integer
  - `sessionId` integer
  - `seq` integer
  - `state` object
  - `summary` string, nullable
  - `tokenEstimate` integer
  - `createdAt` string, date-time

## Other responses

- `400`: Request body/query failed Zod validation.
- `401`: Missing or invalid credentials.

---

[API](https://skmtc.dev/contextq/apis/contextq-api.md) · [All operations](https://skmtc.dev/contextq/apis/contextq-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contextq/apis/contextq-api/revisions/7afc44056a22?raw)
