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
}
}Retrieve all sessions for an organization, along with aggregate stats.
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
}
}Show Session fields
active, completed, or failed.curl -X GET "https://magnet.run/api/sessions" \
-H "x-api-key: YOUR_API_KEY"
{
"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
}
}
| Status | Description |
|---|---|
401 | Invalid or missing authentication |
403 | No access to the specified organization |
500 | Server error |