Complete an externally-registered session
1 min read
Path Parameters
id*string
The session id (stable across daemon restarts).
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/sessions/session-1/complete" \ -H "Content-Type: application/json" \ -d '{ "exitCode": 0 }'{
"id": "session-1",
"project_root": "/Users/example/project",
"harness": "codex",
"title": "Fix failing tests",
"status": "running",
"exit_code": null,
"archived_at": null,
"created_at": "2026-05-09T06:43:00.000Z",
"updated_at": "2026-05-09T06:43:05.000Z",
"conversation_id": null,
"familiar_id": null,
"labels": [],
"visibility": "private",
"external": false,
"transcript_path": null
}{
"error": {
"code": "session_not_found",
"message": "Session was not found.",
"details": {
"sessionId": "session-1"
}
}
}{
"error": {
"code": "not_external_session",
"message": "POST /sessions/<id>/complete is only valid for externally-registered sessions. Use POST /sessions/<id>/kill for daemon-managed sessions.",
"details": {
"sessionId": "session-1"
}
}
}{
"error": {
"code": "internal_error",
"message": "Unexpected internal daemon error.",
"details": {}
}
}Was this page helpful?No