API

Call Datarist directly over REST or GraphQL: base URLs, API keys, SDKs, errors and rate limits, and the OpenAPI and GraphQL schema documentation.

Last updated 28 Nov 2026

Everything the CLI and the SDKs do goes through the Datarist API. You can call it directly from any language that can make HTTPS requests, over REST or GraphQL. Both use the same API keys and return the same data.

Placeholder content. The URLs, package names and responses on this page show the shape of the API documentation. They are examples until the platform is released.

Choose an interface

DetailRESTGraphQL
Base URLhttps://api.datarist.com/v1https://api.datarist.com/graphql
Best forSimple requests, scripts, and tools that already speak HTTP.Fetching exactly the fields you need, across several resources, in one request.
AuthenticationAPI key in the Authorization header.The same API key, the same header.
SchemaOpenAPI document.Introspection and a schema file.

API keys

Send an API key as a bearer token in the Authorization header. Create and revoke keys in your workspace settings. A key belongs to one workspace and carries the permissions of the role it was created with.

  • Use a separate key for each application, so that you can revoke one without affecting the others.
  • Store keys in an environment variable such as DATARIST_API_KEY, which the SDKs and the CLI read by default.
  • To rotate a key, create the new one, deploy it, then revoke the old one.
  • A request without a valid key gets a 401 response.

Keep keys secret. Never put an API key in client-side code, a public repository or a support request. If a key is exposed, revoke it straight away and create a new one.

REST

Make a request

List the first two rows of the orders dataset:

Shell
curl "https://api.datarist.com/v1/datasets/orders/rows?limit=2" \
  --header "Authorization: Bearer $DATARIST_API_KEY"

Responses are JSON. When there is more data, next holds a cursor to pass back as ?cursor=; it is null on the last page.

Response
{
  "data": [
    { "order_id": "O000001", "customer_id": "C00378", "order_date": "2024-02-28", "currency": "GBP", "amount": 109.5, "status": "paid" },
    { "order_id": "O000002", "customer_id": "C00197", "order_date": "2024-03-23", "currency": "EUR", "amount": 101.12, "status": "pending" }
  ],
  "next": "cur_8f3a2c"
}

Resources

ResourceURLMethods
Sourceshttps://api.datarist.com/v1/sourcesGET, POST, DELETE
Datasetshttps://api.datarist.com/v1/datasetsGET
Rows of a datasethttps://api.datarist.com/v1/datasets/{name}/rowsGET
Schema of a datasethttps://api.datarist.com/v1/datasets/{name}/schemaGET
Syncshttps://api.datarist.com/v1/syncsGET, POST

Versioning

The version is part of the URL (/v1). Changes that could break a client, such as removing a field, ship in a new version. Additive changes, such as a new field or a new resource, ship in the current one. Every change to the API is listed in the Changelog.

GraphQL

Send queries as a POST to https://api.datarist.com/graphql, with the same Authorization header. Ask for the fields you need and nothing else:

GraphQL query
query {
  dataset(name: "orders") {
    rows(limit: 2) {
      order_id
      currency
      amount
    }
  }
}
Shell
curl https://api.datarist.com/graphql \
  --header "Authorization: Bearer $DATARIST_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"query": "{ dataset(name: \"orders\") { rows(limit: 2) { order_id amount } } }"}'

GraphQL always answers with status 200 when the request reached the server. Check the errors array in the body, which is absent when the query succeeded.

Errors and rate limits

REST errors use a conventional status code and a JSON body. Quote the request_id when you contact support.

Error response
{
  "error": {
    "code": "unauthorized",
    "message": "The API key is missing or not valid.",
    "request_id": "req_41d9b7"
  }
}
StatusMeaningWhat to do
400The request is malformed.Fix the request. Do not retry it unchanged.
401The API key is missing or not valid.Check the key and the Authorization header.
403The key’s role does not allow this.Use a key with the right role.
404The resource does not exist.Check the name or id.
429Too many requests.Wait for the time in the Retry-After header, then retry.
5xxSomething went wrong on our side.Retry with a growing delay. Check Status.

Limits depend on your plan. Responses carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset headers, so a client can slow down before it is refused.

SDKs

The SDKs wrap the API, read DATARIST_API_KEY for you and handle pagination and retries. They offer the same operations in each language’s own idioms. See Install for first steps in each one.

LanguagePackageInstall
JavaScript and TypeScript@datarist/sdknpm install @datarist/sdk
Pythondataristpip install datarist
.NETDataristdotnet add package Datarist
Gogithub.com/datarist/datarist-gogo get github.com/datarist/datarist-go
Command line@datarist/clinpm install --global @datarist/cli

Schema documentation

The API describes itself, so that you can generate clients, validate requests and explore it in the tools you already use.

WhatWhere
REST: OpenAPI 3 documenthttps://api.datarist.com/v1/openapi.json
GraphQL: schema filehttps://api.datarist.com/graphql/schema.graphql
GraphQL: introspectionSend a standard introspection query to the GraphQL URL.
One dataset’s fieldshttps://api.datarist.com/v1/datasets/{name}/schema

Dataset schemas

The schema of a dataset is its data dictionary: for every field, the name, the type, whether it can be empty, what it means and an example. It has the same shape as the dictionaries you can download from the Dataset page. For example, for orders (shortened):

Response
{
  "dataset": "orders",
  "fields": [
    { "name": "order_id", "type": "string", "nullable": false, "allowed_values": null,
      "description": "Unique order identifier. Primary key.", "example": "O000001" },
    { "name": "currency", "type": "string", "nullable": false, "allowed_values": ["USD", "EUR", "GBP", "KES"],
      "description": "Currency of amount, ISO 4217.", "example": "USD" },
    { "name": "discount_pct", "type": "integer", "nullable": true, "allowed_values": null,
      "description": "Discount applied, in whole percent. Empty when none.", "example": "10" }
  ]
}

Types are string, integer, decimal, boolean, date and datetime. The Methodology page explains how dates, empty values and decimals are written.

Next steps