Skip to main content
PATCH
/
api
/
sessions
/
{sessionId}
Update Session
curl --request PATCH \
  --url https://api.example.com/api/sessions/{sessionId} \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "status": "<string>"
}
'
{
  "session": {}
}

Authentication

Requires an API key.

Path parameters

sessionId
string
required
The ID of the session to update.

Query parameters

organizationId
string
The ID of the organization the session belongs to. Optional when using an API key.

Request body

All fields are optional — only include the fields you want to update.
title
string
New title for the session.
status
string
New status. One of active, completed, or failed.

Response

session
object
The updated session object. See List Sessions for the full schema.

Example

curl -X PATCH "https://magnet.run/api/sessions/cm3abc123def" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Signup form validation (email + password)"
  }'

Response

{
  "session": {
    "id": "cm3abc123def",
    "title": "Signup form validation (email + password)",
    "status": "completed",
    "createdAt": "2026-02-10T14:30:00.000Z",
    "updatedAt": "2026-02-11T09:15:00.000Z",
    "model": "claude-opus-4-6",
    "author": {
      "id": "user_123",
      "name": "Alice Chen"
    },
    "metadata": {
      "repository": "acme/web-app",
      "prNumber": 42,
      "prUrl": "https://github.com/acme/web-app/pull/42",
      "prStatus": "open"
    },
    "messageCount": 12
  }
}

Errors

StatusDescription
400Invalid request body
401Invalid or missing authentication
403No access to the specified organization
404Session not found
500Server error