Browse the API reference

Execute Cypher Statement

post/v1/graphs/{graph_id}/query/cypher

Part of Query.

Cypher over the graph (LadybugDB). Main graphs are read-only — use the staging pipeline to ingest data. Subgraphs support full writes. Always use parameterized queries (parameters: {"key": "val"}) to prevent injection. Response modes: auto (default), sync, async, stream. Under load, queries are queued and emit an operation_id for SSE monitoring at /v1/operations/{id}/stream.

Authentication

Authenticate in any one of these ways — not all of them:

  • API key in the X-API-Key header.
  • Bearer token in the Authorization header.

Path parameters

NameTypeDescription
graph_idrequiredstringGraph Id

Query parameters

NameTypeDescription
modeoptionalResponseModeResponse mode override

One of: auto, sync, async, stream

chunk_sizeoptionalintegerRows per chunk for streaming
test_modeoptionalbooleanEnable test mode for better debugging

Default: false

Request body

Required, application/json.

FieldTypeDescription
queryrequiredstring

The Cypher query to execute. Use parameters ($param_name) for all dynamic values to prevent injection attacks.

parametersoptionalobject

Query parameters for safe value substitution. ALWAYS use parameters instead of string interpolation.

timeoutoptionalinteger

Query timeout in seconds (1-300)

Default: 60

Example request

curl
curl -X POST "https://api.robosystems.ai/v1/graphs/{graph_id}/query/cypher" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "parameters": {
    "entity_type": "Company",
    "limit": 100
  },
  "query": "MATCH (n:Entity {type: $entity_type}) RETURN n LIMIT $limit",
  "timeout": 60
}'

Responses

200 Successful Response

Response
"string"
StatusMeaning
202Query queued — monitor via SSE at /v1/operations/{operation_id}/stream
400Invalid request
401Authentication required
403Access denied
404Resource not found
408Query timeout
422Validation Error
429Rate limit exceeded
500Internal server error
503Service unavailable