Jepto
Developer Docs
Developer docs

REST API

REST endpoints for clients, schema and queries, with request bodies, status codes, long-running queries and errors.

The REST API sends the request JSON as the body of an HTTPS request. Every body is exactly the variables of the matching GraphQL operation.

Base URLhttps://data.jepto.com
AuthenticationAuthorization: Bearer <access_token>. See Authentication.
Request bodyJSON, with Content-Type: application/json
ResponsesJSON, UTF-8. Errors use one format; see Errors.

Endpoints

GET/clientsList the clients you can access
POST/schemaList a client’s sources and fields. Body: { clientId, source, fieldType }
POST/queryRun a query. Body: { clientId, query }
POST/query/resultGet the result of a long-running query. Body: { queryId }
RESTGraphQL operationBody = variables
GET /clientsclientsnone
POST /schemaanalyticsSchema{ "clientId", "source", "fieldType" }
POST /queryanalyticsQuery{ "clientId", "query" }
POST /query/resultanalyticsQueryResult{ "queryId" }
clientId valueAllowed inMeaning
16 lowercase hex characters, from GET /clientsPOST /schema, POST /queryOne client
"all_clients"POST /schema onlyThe account-wide data model: the union of every client’s fields. See Account-wide data model.

Any other value, or "all_clients" in POST /query, returns 400 INVALID_REQUEST. To query several clients, send one query per client. Unknown body keys are rejected the same way.

‍

List clients

GET/clientsActive clients your user can access, sorted by name. Archived clients aren’t included.
Request
curl https://data.jepto.com/clients \
  -H "Authorization: Bearer $JEPTO_TOKEN"
Response200 OK
{
  "clients": [
    {
      "clientId": "b1c2d3e4f5a6b7c8",
      "name": "Glaze Co",
      "domain": "glazeco.com"
    },
    {
      "clientId": "a1b2c3d4e5f6a7b8",
      "name": "Homer’s Donuts",
      "domain": "homersdonuts.com"
    }
  ]
}
FieldTypeDescription
clientIdstring16 hex characters. Use it in the other endpoints.
namestringClient name in Jepto
domainstring or nullThe client’s website domain, if set
StatusCodeWhen
200Success, including an empty list
401UNAUTHENTICATEDMissing, invalid or expired token
403FORBIDDENThe user can’t read clients

‍

Get schema

POST/schemaThe client’s connected sources, metrics and dimensions.
Body keyTypeRequiredDescription
clientIdstringyesA client from GET /clients, or "all_clients" for the account-wide data model
sourcestringnoOnly fields from one source: a source type such as googleAds, bigQuery or unified, or a dataSourceId such as ds_a1b2c3d4e5f6a7b8 for one BigQuery table. Case-sensitive. See source keys.
fieldType"metrics" or "dimensions"noOnly that kind of field. Leave out for both.
Request
curl -X POST https://data.jepto.com/schema \
  -H "Authorization: Bearer $JEPTO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "clientId": "a1b2c3d4e5f6a7b8",
    "source": "googleAds",
    "fieldType": "metrics"
  }'

The response is { "sources", "metrics", "dimensions" }. Every field is described in Fields and Schema. With fieldType, the other list is [].

StatusCodeWhen
200Success
400INVALID_REQUESTMalformed clientId, unknown fieldType, a source the client doesn’t have, or an unknown body key
401UNAUTHENTICATEDMissing, invalid or expired token
403FORBIDDENThe user can’t read this client
404CLIENT_NOT_FOUNDNo active client with this ID in your account

‍

Run a query

POST/queryRuns a query for one client.
Body keyTypeRequiredDescription
clientIdstringyesOne client from GET /clients. "all_clients" isn’t accepted here.
queryobjectyesThe query. Every key is described in Queries.
Request
curl -X POST https://data.jepto.com/query \
  -H "Authorization: Bearer $JEPTO_TOKEN" \
  -H "Content-Type: application/json" \
  -d @query.json
query.json
{
  "clientId": "a1b2c3d4e5f6a7b8",
  "query": {
    "measures": ["googleAds.spend", "googleAds.clicks"],
    "dimensions": ["googleAds.campaignName"],
    "timeDimensions": [
      {
        "dimension": "googleAds.date",
        "dateRange": [
          "30DaysAgo",
          "yesterday"
        ]
      }
    ],
    "order": [
      {
        "member": "googleAds.spend",
        "direction": "desc"
      }
    ],
    "limit": 100,
    "total": true
  }
}
Response200 OK
{
  "queryId": "qry_a1b2c3d4e5f6a7b8",
  "status": "COMPLETE",
  "data": [
    {
      "googleAds.campaignName": "Brand | Search",
      "googleAds.spend": 1840.5,
      "googleAds.clicks": 2210
    },
    {
      "googleAds.campaignName": "Donuts Near Me | Search",
      "googleAds.spend": 1312.75,
      "googleAds.clicks": 1486
    }
  ],
  "total": 2,
  "annotation": {
    "measures": {
      "googleAds.spend": {
        "label": "Spend"
      },
      "googleAds.clicks": {
        "label": "Clicks"
      }
    },
    "dimensions": {
      "googleAds.campaignName": {
        "label": "Campaign Name"
      }
    },
    "segments": {},
    "timeDimensions": {}
  },
  "lastRefreshTime": "2026-11-24T03:12:45.123456Z",
  "cacheStatus": "computed"
}

Response fields are listed in Queries → Response.

StatusCodeWhen
200The query finished. status is COMPLETE, or FAILED with an error if it failed while running.
202Still running after about 25 seconds. status is RUNNING. See below.
400INVALID_REQUESTMalformed clientId, invalid JSON, or a body that isn’t { clientId, query }
400INVALID_QUERYThe query breaks a rule: unknown key or field, bad date range or token, wrong filter values, unsupported granularity…
401UNAUTHENTICATEDMissing, invalid or expired token
403FORBIDDENThe user can’t read this client
404CLIENT_NOT_FOUNDNo active client with this ID in your account
429RATE_LIMITEDToo many requests. Retry after Retry-After seconds.

‍

Long-running queries

Most queries finish within a few seconds. A query that needs fresh data from a slow platform, or covers a long range, can take longer. The API waits about 25 seconds, then answers 202 Accepted with a Retry-After header while the query keeps running:

Response202 Accepted · Retry-After: 3
{ "queryId": "qry_a1b2c3d4e5f6a7b8", "status": "RUNNING" }
POST/query/resultThe current state of a query you started.
Request
curl -X POST https://data.jepto.com/query/result \
  -H "Authorization: Bearer $JEPTO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "queryId": "qry_a1b2c3d4e5f6a7b8" }'
StatusBodyMeaning
200status: "RUNNING"Not done yet. Wait Retry-After seconds and ask again.
200status: "COMPLETE"Done. The body is the full result, in the same shape as a query that finished straight away.
200status: "FAILED"The query failed while running. See error.code and error.message.
404QUERY_NOT_FOUNDUnknown queryId, more than an hour old, or started by another user
  • A query runs for at most 5 minutes, then fails with QUERY_TIMEOUT.
  • Results are kept for one hour after the query finishes. After that, run the query again; it’s usually served from the cache.
  • Only the user who started a query can read its queryId.
  • Don’t send POST /query again while a query is running. Ask for the queryId instead.

This Python function handles both cases and returns the rows:

query.py
import json, os, time, urllib.request

API = "https://data.jepto.com"
TOKEN = os.environ["JEPTO_TOKEN"]

def call(path, body):
    request = urllib.request.Request(
        API + path,
        method="POST",
        data=json.dumps(body).encode(),
        headers={
            "Authorization": "Bearer " + TOKEN,
            "Content-Type": "application/json",
        },
    )
    with urllib.request.urlopen(request) as response:
        return json.load(response), response.headers.get("Retry-After")

def run_query(client_id, query):
    result, retry_after = call("/query", {"clientId": client_id, "query": query})
    while result["status"] == "RUNNING":
        time.sleep(int(retry_after or 3))
        result, retry_after = call("/query/result", {"queryId": result["queryId"]})
    if result["status"] == "FAILED":
        error = result["error"]
        raise RuntimeError(error["code"] + ": " + error["message"])
    return result["data"]

‍

Errors

Every error response has this shape. Codes are listed in Errors and Limits.

Response400 Bad Request
{
  "error": {
    "code": "INVALID_QUERY",
    "message": "Only one timeDimensions entry is supported per query."
  }
}