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 URL | https://data.jepto.com |
|---|---|
| Authentication | Authorization: Bearer <access_token>. See Authentication. |
| Request body | JSON, with Content-Type: application/json |
| Responses | JSON, UTF-8. Errors use one format; see Errors. |
{ clientId, source, fieldType }{ clientId, query }{ queryId }| REST | GraphQL operation | Body = variables |
|---|---|---|
GET /clients | clients | none |
POST /schema | analyticsSchema | { "clientId", "source", "fieldType" } |
POST /query | analyticsQuery | { "clientId", "query" } |
POST /query/result | analyticsQueryResult | { "queryId" } |
clientId value | Allowed in | Meaning |
|---|---|---|
16 lowercase hex characters, from GET /clients | POST /schema, POST /query | One client |
"all_clients" | POST /schema only | The 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.
curl https://data.jepto.com/clients \ -H "Authorization: Bearer $JEPTO_TOKEN"
200 OK{
"clients": [
{
"clientId": "b1c2d3e4f5a6b7c8",
"name": "Glaze Co",
"domain": "glazeco.com"
},
{
"clientId": "a1b2c3d4e5f6a7b8",
"name": "Homer’s Donuts",
"domain": "homersdonuts.com"
}
]
}| Field | Type | Description |
|---|---|---|
clientId | string | 16 hex characters. Use it in the other endpoints. |
name | string | Client name in Jepto |
domain | string or null | The client’s website domain, if set |
| Status | Code | When |
|---|---|---|
| 200 | Success, including an empty list | |
| 401 | UNAUTHENTICATED | Missing, invalid or expired token |
| 403 | FORBIDDEN | The user can’t read clients |
| Body key | Type | Required | Description |
|---|---|---|---|
clientId | string | yes | A client from GET /clients, or "all_clients" for the account-wide data model |
source | string | no | Only 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" | no | Only that kind of field. Leave out for both. |
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 [].
| Status | Code | When |
|---|---|---|
| 200 | Success | |
| 400 | INVALID_REQUEST | Malformed clientId, unknown fieldType, a source the client doesn’t have, or an unknown body key |
| 401 | UNAUTHENTICATED | Missing, invalid or expired token |
| 403 | FORBIDDEN | The user can’t read this client |
| 404 | CLIENT_NOT_FOUND | No active client with this ID in your account |
| Body key | Type | Required | Description |
|---|---|---|---|
clientId | string | yes | One client from GET /clients. "all_clients" isn’t accepted here. |
query | object | yes | The query. Every key is described in Queries. |
curl -X POST https://data.jepto.com/query \ -H "Authorization: Bearer $JEPTO_TOKEN" \ -H "Content-Type: application/json" \ -d @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
}
}200 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.
| Status | Code | When |
|---|---|---|
| 200 | The query finished. status is COMPLETE, or FAILED with an error if it failed while running. | |
| 202 | Still running after about 25 seconds. status is RUNNING. See below. | |
| 400 | INVALID_REQUEST | Malformed clientId, invalid JSON, or a body that isn’t { clientId, query } |
| 400 | INVALID_QUERY | The query breaks a rule: unknown key or field, bad date range or token, wrong filter values, unsupported granularity… |
| 401 | UNAUTHENTICATED | Missing, invalid or expired token |
| 403 | FORBIDDEN | The user can’t read this client |
| 404 | CLIENT_NOT_FOUND | No active client with this ID in your account |
| 429 | RATE_LIMITED | Too many requests. Retry after Retry-After seconds. |
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:
202 Accepted · Retry-After: 3{ "queryId": "qry_a1b2c3d4e5f6a7b8", "status": "RUNNING" }curl -X POST https://data.jepto.com/query/result \ -H "Authorization: Bearer $JEPTO_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "queryId": "qry_a1b2c3d4e5f6a7b8" }'
| Status | Body | Meaning |
|---|---|---|
| 200 | status: "RUNNING" | Not done yet. Wait Retry-After seconds and ask again. |
| 200 | status: "COMPLETE" | Done. The body is the full result, in the same shape as a query that finished straight away. |
| 200 | status: "FAILED" | The query failed while running. See error.code and error.message. |
| 404 | QUERY_NOT_FOUND | Unknown queryId, more than an hour old, or started by another user |
QUERY_TIMEOUT.queryId.POST /query again while a query is running. Ask for the queryId instead.This Python function handles both cases and returns the rows:
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"]
Every error response has this shape. Codes are listed in Errors and Limits.
400 Bad Request{
"error": {
"code": "INVALID_QUERY",
"message": "Only one timeDimensions entry is supported per query."
}
}