List Sessions
curl --request GET \
--url https://api.example.com/api/sessions{
"sessions": [
{
"id": "<string>",
"title": "<string>",
"status": "<string>",
"createdAt": {},
"updatedAt": {},
"model": "<string>",
"author": {
"id": "<string>",
"name": "<string>",
"imageUrl": "<string>"
},
"metadata": {
"repository": "<string>",
"branch": "<string>",
"prNumber": 123,
"prUrl": "<string>",
"prStatus": "<string>"
},
"messageCount": 123,
"firstMessagePreview": "<string>",
"lastMessagePreview": "<string>"
}
],
"stats": {
"mergesPastWeek": 123,
"authorsPastWeek": 123,
"humansPastWeek": 123,
"humansPromptingNow": 123
}
}Sessions
List Sessions
Retrieve all sessions for a workspace, along with aggregate stats.
GET
/
api
/
sessions
List Sessions
curl --request GET \
--url https://api.example.com/api/sessions{
"sessions": [
{
"id": "<string>",
"title": "<string>",
"status": "<string>",
"createdAt": {},
"updatedAt": {},
"model": "<string>",
"author": {
"id": "<string>",
"name": "<string>",
"imageUrl": "<string>"
},
"metadata": {
"repository": "<string>",
"branch": "<string>",
"prNumber": 123,
"prUrl": "<string>",
"prStatus": "<string>"
},
"messageCount": 123,
"firstMessagePreview": "<string>",
"lastMessagePreview": "<string>"
}
],
"stats": {
"mergesPastWeek": 123,
"authorsPastWeek": 123,
"humansPastWeek": 123,
"humansPromptingNow": 123
}
}Authentication
Requires an API key.Query parameters
The ID of the workspace to list sessions for. Optional when using an API key (resolved automatically).
Response
Array of session objects (without full message history).
Show Session fields
Show Session fields
Unique session identifier.
Session title (auto-generated or user-provided).
One of
active, completed, or failed.When the session was created.
When the session was last updated.
The Claude model used.
Total number of messages in the session.
Preview of the first message.
Preview of the most recent message.
Aggregate statistics for the workspace.
Example
curl -X GET "https://magnet.run/api/sessions" \
-H "x-api-key: YOUR_API_KEY"
Response
{
"sessions": [
{
"id": "cm3abc123def",
"title": "Add input validation to signup form",
"status": "completed",
"createdAt": "2026-02-10T14:30:00.000Z",
"updatedAt": "2026-02-10T14:45:00.000Z",
"model": "claude-opus-4-6",
"author": {
"id": "user_123",
"name": "Alice Chen"
},
"metadata": {
"repository": "acme/web-app",
"branch": "agent/add-signup-validation",
"prNumber": 42,
"prUrl": "https://github.com/acme/web-app/pull/42",
"prStatus": "open"
},
"messageCount": 12,
"firstMessagePreview": "Add input validation to the signup form...",
"lastMessagePreview": "I've opened PR #42 with the changes..."
}
],
"stats": {
"mergesPastWeek": 8,
"authorsPastWeek": 3,
"humansPastWeek": 5,
"humansPromptingNow": 1
}
}
Errors
| Status | Description |
|---|---|
401 | Invalid or missing authentication |
403 | No access to the specified workspace |
500 | Server error |
⌘I