Retrieve an event
GET/graphs/{graph_id}/events/{event_id}
Retrieves one event, with every change it made. expand[]=node adds its node as it stood just after it. An event older than the graph’s retained history is 410 outside_retention_window.
Query Parameters
Retrieve an event
curl https://agentgraph.chofter.com/api/v1/graphs/$GRAPH_ID/events/$EVENT_ID \
-H "Authorization: Bearer $AGENT_GRAPH_API_KEY"{
"id": "evt_01M4G2FMPN7KD3N1PZ0QX8RM4A",
"object": "event",
"type": "agent.spawned",
"created": 1791540843221,
"graph_id": "gph_k3P9xQ2mWt7a",
"node_id": "node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEwL2EzZmQwN2MyYjE5ZTRkNjE",
"source": {
"provider": "claude-code",
"provider_version": "2.1.260",
"adapter": "claude-code@1"
},
"payload": {
"agent_type": "Explore",
"purpose": "Find every caller of the old session store"
},
"changes": [
{
"node_id": "node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEwL2EzZmQwN2MyYjE5ZTRkNjE",
"created": true,
"fields": {
"state": {
"from": null,
"to": "working"
},
"parent_id": {
"from": null,
"to": "node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEw"
}
}
},
{
"node_id": "node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEw",
"created": false,
"fields": {
"child_count": {
"from": 2,
"to": 3
},
"descendant_count": {
"from": 4,
"to": 5
},
"blocked": {
"from": null,
"to": {
"on_ids": [
"node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEwL2EzZmQwN2MyYjE5ZTRkNjE"
],
"starting": 0,
"node_count": 1,
"open_tasks": 0,
"cycle": false
}
}
}
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "Invalid limit: must be between 1 and 1000.",
"param": "limit",
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "expand_too_deep",
"message": "The path children.children.children.children.children goes 5 levels deep; at most 4 are allowed.",
"param": "expand",
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "authentication_error",
"code": "api_key_invalid",
"message": "Invalid API key: ag_sk_live_****Xa9T.",
"param": null,
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "permission_error",
"code": "api_key_restricted",
"message": "This restricted key can't read gph_k3P9xQ2mWt7a.",
"param": null,
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "No such node: node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEwL2I4MWMyMmUwOWY3YTNjNTU.",
"param": "node_id",
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "node_not_yet_created",
"message": "The node node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEwL2EzZmQwN2MyYjE5ZTRkNjE is created by evt_01M4G2FMPN7KD3N1PZ0QX8RM4A, after as_of.",
"param": "as_of",
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors",
"first_event_id": "evt_01M4G2FMPN7KD3N1PZ0QX8RM4A"
}
}{
"error": {
"type": "invalid_request_error",
"code": "outside_retention_window",
"message": "This graph holds events from evt_01M4FXYWR82B8XK0V5QJ7M1N3R to evt_01M4G3G4E8Q9R2M5X4T6W8Y0B1.",
"param": "as_of",
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors",
"first_event_id": "evt_01M4FXYWR82B8XK0V5QJ7M1N3R",
"last_event_id": "evt_01M4G3G4E8Q9R2M5X4T6W8Y0B1"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limit",
"message": "Too many requests. Try again in 1 second.",
"param": null,
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "api_error",
"code": "api_error",
"message": "Something went wrong. Try again, and include the Request-Id if it keeps happening.",
"param": null,
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}Returns Examples
{
"id": "evt_01M4G2FMPN7KD3N1PZ0QX8RM4A",
"object": "event",
"type": "agent.spawned",
"created": 1791540843221,
"graph_id": "gph_k3P9xQ2mWt7a",
"node_id": "node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEwL2EzZmQwN2MyYjE5ZTRkNjE",
"source": {
"provider": "claude-code",
"provider_version": "2.1.260",
"adapter": "claude-code@1"
},
"payload": {
"agent_type": "Explore",
"purpose": "Find every caller of the old session store"
},
"changes": [
{
"node_id": "node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEwL2EzZmQwN2MyYjE5ZTRkNjE",
"created": true,
"fields": {
"state": {
"from": null,
"to": "working"
},
"parent_id": {
"from": null,
"to": "node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEw"
}
}
},
{
"node_id": "node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEw",
"created": false,
"fields": {
"child_count": {
"from": 2,
"to": 3
},
"descendant_count": {
"from": 4,
"to": 5
},
"blocked": {
"from": null,
"to": {
"on_ids": [
"node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEwL2EzZmQwN2MyYjE5ZTRkNjE"
],
"starting": 0,
"node_count": 1,
"open_tasks": 0,
"cycle": false
}
}
}
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "Invalid limit: must be between 1 and 1000.",
"param": "limit",
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "expand_too_deep",
"message": "The path children.children.children.children.children goes 5 levels deep; at most 4 are allowed.",
"param": "expand",
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "authentication_error",
"code": "api_key_invalid",
"message": "Invalid API key: ag_sk_live_****Xa9T.",
"param": null,
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "permission_error",
"code": "api_key_restricted",
"message": "This restricted key can't read gph_k3P9xQ2mWt7a.",
"param": null,
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "No such node: node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEwL2I4MWMyMmUwOWY3YTNjNTU.",
"param": "node_id",
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "invalid_request_error",
"code": "node_not_yet_created",
"message": "The node node_Y2xhdWRlLWNvZGU6NWYyYzFlOWEtOGQxYi00YjZlLTlhNTEtMGY2ZjJjN2QzZTEwL2EzZmQwN2MyYjE5ZTRkNjE is created by evt_01M4G2FMPN7KD3N1PZ0QX8RM4A, after as_of.",
"param": "as_of",
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors",
"first_event_id": "evt_01M4G2FMPN7KD3N1PZ0QX8RM4A"
}
}{
"error": {
"type": "invalid_request_error",
"code": "outside_retention_window",
"message": "This graph holds events from evt_01M4FXYWR82B8XK0V5QJ7M1N3R to evt_01M4G3G4E8Q9R2M5X4T6W8Y0B1.",
"param": "as_of",
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors",
"first_event_id": "evt_01M4FXYWR82B8XK0V5QJ7M1N3R",
"last_event_id": "evt_01M4G3G4E8Q9R2M5X4T6W8Y0B1"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limit",
"message": "Too many requests. Try again in 1 second.",
"param": null,
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}{
"error": {
"type": "api_error",
"code": "api_error",
"message": "Something went wrong. Try again, and include the Request-Id if it keeps happening.",
"param": null,
"doc_url": "https://agentgraph.chofter.com/docs/reference#errors"
}
}