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": "21.06-1.17.1-beta",
  • "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

in-args-edn
Array of any
Example: in-args-edn=["foo" 123]

EDN formatted :in binding arguments

in-args-json
Array of any
Example: in-args-json=["foo",123]

JSON formatted :in binding arguments

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

in-args-edn
Array of any
Example: in-args-edn=["foo" 123]

EDN formatted :in binding arguments

in-args-json
Array of any
Example: in-args-json=["foo",123]

JSON formatted :in binding arguments

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

Datalog query

in-args
Array of any (crux.http-server.query/in-args)

:in binding arguments

Responses

Request samples

Content type
{
  • "query": {
    },
  • "in-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

Response samples

Content type
{
  • "txTime": "2020-10-16T14:29:35Z"
}

Await Tx

Wait until the node has indexed a transaction at or past the supplied tx-id

query Parameters
tx-id
required
integer <int64>
timeout
integer <int64>

Responses

Response samples

Content type
{
  • "txId": 5,
  • "txTime": "2020-10-16T14:29:35Z"
}

Await Tx Time

Wait until the node has indexed a transaction that is past the supplied tx-time

query Parameters
tx-time
required
string
timeout
integer <int64>

Responses

Response samples

Content type
{
  • "txTime": "2020-10-16T14:29:35Z"
}

Tx Log

Get a list of all transactions

query Parameters
with-ops?
boolean
after-tx-id
integer <int64>

Responses

Response samples

Content type
[
  • {
    },
  • {
    }
]

Submit Tx

Takes a vector of transactions - Writes to the node

Request Body schema:
tx-ops
required
Array of any

Responses

Request samples

Content type
{
  • "tx-ops": [
    ]
}

Response samples

Content type
{
  • "txId": 6,
  • "txTime": "2020-10-19T09:21:29Z"
}

Tx Committed

Checks if a submitted tx was successfully committed

query Parameters
tx-id
required
integer <int64>

Responses

Response samples

Content type
{
  • "txCommitted?": true
}

Latest Completed Tx

Get the latest transaction to have been indexed by this node

Responses

Response samples

Content type
{
  • "txId": 5,
  • "txTime": "2020-10-16T14:29:35Z"
}

Latest Submitted Tx

Get the latest transaction to have been submitted to this cluster

Responses

Response samples

Content type
{
  • "txId": 5
}

Active Queries

Get a list of currently running queries

Responses

Response samples

Content type
[
  • {
    }
]

Recent Queries

Get a list of recently completed/failed queries

Responses

Response samples

Content type
[
  • {
    }
]

Slowest Queries

Get a list of slowest completed/failed queries ran on the node

Responses

Response samples

Content type
[
  • {
    }
]