The public GraphQL schema and operations for clients, schema and queries, with typed inputs and errors.
The GraphQL API sends the request JSON as the variables of a GraphQL operation on one endpoint. Every operation’s variables are exactly the body of the matching REST request.
| Endpoint | https://api.jepto.com/graphql |
|---|---|
| Method | POST, body { "query": "…", "variables": { … } }, Content-Type: application/json |
| Authentication | Authorization: Bearer <access_token>. See Authentication. |
| Responses | Always HTTP 200. Failures are in the errors array. |
| Operation | Variables | Same as |
|---|---|---|
clients | none | GET /clients |
analyticsSchema | clientId (a client or "all_clients"), source, fieldType | POST /schema |
analyticsQuery | clientId (one client), query | POST /query |
analyticsQueryResult | queryId | POST /query/result |
The public schema. Inputs mirror the REST bodies key for key, and enum values are lowercase so the same JSON is valid in both. The query input is described key by key in Queries.
type Query { clients: [Client!]! analyticsSchema( clientId: ID! source: String fieldType: FieldType ): AnalyticsSchema! analyticsQuery(clientId: ID!, query: AnalyticsQueryInput!): AnalyticsQueryResult! analyticsQueryResult(queryId: ID!): AnalyticsQueryResult! } # ---- inputs (same JSON as the REST bodies) input AnalyticsQueryInput { measures: [String!] dimensions: [String!] timeDimensions: [TimeDimensionInput!] filters: [FilterInput!] order: [OrderInput!] measureAggregations: [MeasureAggregationInput!] limit: Int offset: Int total: Boolean timezone: String renewQuery: Boolean } input TimeDimensionInput { dimension: String! dateRange: [String!] granularity: Granularity compareDateRange: [[String!]!] } input FilterInput { member: String operator: FilterOperator values: [String!] and: [FilterInput!] or: [FilterInput!] } input OrderInput { member: String! direction: SortDirection! } input MeasureAggregationInput { member: String! aggregation: Aggregation! } enum FieldType { metrics dimensions } enum Granularity { day week sunday_week month quarter year } enum SortDirection { asc desc } enum Aggregation { sum avg min max count count_distinct } enum FilterOperator { equals notEquals contains notContains startsWith notStartsWith endsWith notEndsWith gt gte lt lte set notSet inDateRange notInDateRange beforeDate afterDate } # ---- results type Client { clientId: ID! name: String! domain: String } type AnalyticsSchema { sources: [AnalyticSource!]! metrics: [AnalyticField!]! dimensions: [AnalyticField!]! } type AnalyticSource { dataSourceId: String type: String! label: String! } type AnalyticField { name: String! label: String! kind: String! type: String description: String format: AWSJSON aggregation: Aggregation periodRollup: String formula: String weightedBy: String sourceGroup: String dataSources: [String!] isCustomField: Boolean! dateGrain: Granularity isDefaultDateField: Boolean } type AnalyticsQueryResult { queryId: ID! status: QueryStatus! queryType: String data: AWSJSON results: AWSJSON total: Int annotation: AWSJSON lastRefreshTime: String cacheStatus: String error: QueryError } enum QueryStatus { COMPLETE RUNNING FAILED } type QueryError { code: String! message: String! } scalar AWSJSON
query Clients {
clients { clientId name domain }
}curl -X POST https://api.jepto.com/graphql \ -H "Authorization: Bearer $JEPTO_TOKEN" \ -H "Content-Type: application/json" \ -d '{"query": "query Clients { clients { clientId name domain } }"}'
{
"data": {
"clients": [
{
"clientId": "a1b2c3d4e5f6a7b8",
"name": "Homer’s Donuts",
"domain": "homersdonuts.com"
}
]
}
}
query Schema($clientId: ID!, $source: String, $fieldType: FieldType) { analyticsSchema(clientId: $clientId, source: $source, fieldType: $fieldType) { sources { dataSourceId type label } metrics { name label kind type format description aggregation periodRollup formula weightedBy dateGrain sourceGroup dataSources isCustomField } dimensions { name label kind type description sourceGroup dataSources isCustomField isDefaultDateField } } }
{
"clientId": "a1b2c3d4e5f6a7b8",
"source": "googleAds",
"fieldType": "metrics"
}Fields are described in Fields and Schema.
query RunQuery($clientId: ID!, $query: AnalyticsQueryInput!) { analyticsQuery(clientId: $clientId, query: $query) { queryId status queryType data results total annotation lastRefreshTime cacheStatus error { code message } } }
{
"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
}
}{
"data": {
"analyticsQuery": {
"queryId": "qry_a1b2c3d4e5f6a7b8",
"status": "COMPLETE",
"queryType": null,
"data": "[{\"googleAds.spend\":1840.5}]",
"results": null,
"total": 1,
"annotation": "{\"measures\":{\"googleAds.spend\":{\"label\":\"Spend\"}}}",
"lastRefreshTime": "2026-11-24T03:12:45.123456Z",
"cacheStatus": "computed",
"error": null
}
}
}data, results and annotation are AWSJSON: JSON returned as a string. Parse them with JSON.parse or json.loads. Everything else is typed.
analyticsQuery waits about 25 seconds. If the query is still running it returns status: RUNNING with a queryId and null data. Ask analyticsQueryResult every few seconds until status changes:
query QueryResult($queryId: ID!) { analyticsQueryResult(queryId: $queryId) { queryId status queryType data results total annotation lastRefreshTime cacheStatus error { code message } } }
{ "queryId": "qry_a1b2c3d4e5f6a7b8" }The same rules apply as for REST: a 5-minute run limit, results kept for one hour, readable only by the user who started the query. See REST API → Long-running queries.
Request errors come back in errors, with the code in errorType. The codes are the same as REST:
200 OK{
"data": null,
"errors": [
{
"errorType": "INVALID_QUERY",
"message": "Unknown field googleAds.campaign_name.",
"path": ["analyticsQuery"]
}
]
}granularity: "hourly") fails GraphQL validation before the query runs, with errorType: "ValidationError". The same mistake through REST returns INVALID_QUERY.errorType: "UnauthorizedException". Refresh the token.status: FAILED with error, not an entry in errors.