Crux API

Download OpenAPI specification:Download

DB

Get the resolved db-basis for the given valid-time/transactoin

query Parameters
valid-time
string
tx-time
string
tx-id
integer <int64>

Responses

Response samples

Content type
{
  • "txId": 4,
  • "txTime": "2020-11-04T15:43:12Z",
  • "validTime": "2020-11-05T17:19:39Z"
}

Status

Get status information from the node

Responses

Response samples

Content type
{
  • "kvStore": "crux.rocksdb.RocksKv",
  • "estimateNumKeys": 3,
  • "revision": null,
  • "consumerState": null,
  • "indexVersion": 13,
  • "version": "20.09-1.11.1-beta-SNAPSHOT",
  • "size": 132665
}

Entity

Get information about a particular entity

query Parameters
sort-order
string
start-tx-id
integer <int64>
valid-time
string
end-tx-id
integer <int64>
link-entities?
boolean
eid-json
string

JSON formatted entity ID

with-corrections
boolean
start-tx-time
string
eid-edn
string

EDN formatted entity ID

start-valid-time
string
tx-time
string
end-tx-time
string
with-docs
boolean
history
boolean
eid
string
tx-id
integer <int64>
end-valid-time
string

Responses

Response samples

Content type
{
  • "age": 20,
  • "crux.db/id": "hello"
}

Query

Perform a datalog query

query Parameters
valid-time
string
tx-time
string
link-entities?
boolean
query-edn
string
Example: query-edn={:find [e], :where [[e :crux.db/id _]], :limit 100}

EDN formatted Datalog query

Responses

Response samples

Content type
[
  • [
    ],
  • [
    ],
  • [
    ]
]

Query

Perform a datalog query

query Parameters
valid-time
string
tx-time
string
link-entities?
boolean
query-edn
string
Example: query-edn={:find [e], :where [[e :crux.db/id _]], :limit 100}

EDN formatted Datalog query

Request Body schema:
query
required
any (crux.http-server.query/query)

Datalog query

args
Array of any

Responses

Request samples

Content type
{
  • "query": {
    },
  • "args": [
    ]
}

Response samples

Content type
[
  • [
    ],
  • [
    ],
  • [
    ]
]

Entity Tx

Get transactional information an particular entity

query Parameters
eid-edn
required
string

EDN formatted entity ID

eid-json
required
string

JSON formatted entity ID

eid
required
string
valid-time
string
tx-time
string
tx-id
integer <int64>

Responses

Response samples

Content type
{
  • "txId": 5,
  • "contentHash": "99747f80357c336ee5efd073c878313bf85b07f9",
  • "txTime": "2020-10-16T14:29:35Z",
  • "id": "5aeebab117b892fa42002146e4c62be676bc4621",
  • "validTime": "2020-10-16T14:29:35Z"
}

Attribute Stats

Get frequencies of indexed attributes

Responses

Response samples

Content type
{
  • "first-name": 2,
  • "age": 1,
  • "crux.db/id": 3,
  • "lastName": 1,
  • "last-name": 2,
  • "firstName": 1
}

Sync

Wait until the Kafka consumer’s lag is back to 0

query Parameters
tx-time
string
timeout
integer <int64>

Responses