Skip to main content
GET
/
api
/
sessions
/
{sessionId}
Get Session
curl --request GET \
  --url https://api.example.com/api/sessions/{sessionId}
{
  "session": {
    "id": "<string>",
    "title": "<string>",
    "status": "<string>",
    "createdAt": {},
    "updatedAt": {},
    "model": "<string>",
    "author": {},
    "metadata": {},
    "messages": [
      {}
    ],
    "tasks": [
      {
        "id": "<string>",
        "title": "<string>",
        "status": "<string>"
      }
    ]
  }
}

Authentication

Requires an API key.

Path parameters

sessionId
string
required
The ID of the session to retrieve.

Query parameters

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

Response

session
object
The full session object including messages.

Example

curl -X GET "https://magnet.run/api/sessions/cm3abc123def" \
  -H "x-api-key: YOUR_API_KEY"

Response

{
  "session": {
    "id": "cm3abc123def",
    "title": "Add input validation to signup form",
    "status": "completed",
    "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"
    },
    "messages": [
      {
        "type": "user",
        "message": {
          "content": "Add input validation to the signup form..."
        }
      },
      {
        "type": "assistant",
        "message": {
          "content": [
            {
              "type": "text",
              "text": "I'll add validation to the signup form..."
            }
          ]
        }
      }
    ],
    "tasks": [
      {
        "id": "task_1",
        "title": "Add email validation",
        "status": "completed"
      }
    ]
  }
}

Errors

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