Jepto
Developer Docs
Developer docs

GraphQL API

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.

Endpointhttps://api.jepto.com/graphql
MethodPOST, body { "query": "…", "variables": { … } }, Content-Type: application/json
AuthenticationAuthorization: Bearer <access_token>. See Authentication.
ResponsesAlways HTTP 200. Failures are in the errors array.
The Jepto app uses the same endpoint, so introspection shows many more fields. Only the operations and types on this page are part of the public API. Anything else can change without notice.

Operations

OperationVariablesSame as
clientsnoneGET /clients
analyticsSchemaclientId (a client or "all_clients"), source, fieldTypePOST /schema
analyticsQueryclientId (one client), queryPOST /query
analyticsQueryResultqueryIdPOST /query/result

Types

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.

Schema (SDL)
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

‍

List clients

Query
query Clients {
  clients { clientId name domain }
}
Request
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 } }"}'
Response
{
  "data": {
    "clients": [
      {
        "clientId": "a1b2c3d4e5f6a7b8",
        "name": "Homer’s Donuts",
        "domain": "homersdonuts.com"
      }
    ]
  }
}

‍

Get schema

Query
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
    }
  }
}
Variables (= POST /schema body)
{
  "clientId": "a1b2c3d4e5f6a7b8",
  "source": "googleAds",
  "fieldType": "metrics"
}

Fields are described in Fields and Schema.

‍

Run a query

Query
query RunQuery($clientId: ID!, $query: AnalyticsQueryInput!) {
  analyticsQuery(clientId: $clientId, query: $query) {
    queryId
    status
    queryType
    data
    results
    total
    annotation
    lastRefreshTime
    cacheStatus
    error { code message }
  }
}
Variables (= POST /query body)
{
  "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
  }
}
Response
{
  "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
    }
  }
}
  • Rows have a key per requested field, which GraphQL can’t type, so data, results and annotation are AWSJSON: JSON returned as a string. Parse them with JSON.parse or json.loads. Everything else is typed.
  • Apart from those three strings, the result has the same fields and values as the REST response.

‍

Long-running queries

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
query QueryResult($queryId: ID!) {
  analyticsQueryResult(queryId: $queryId) {
    queryId
    status
    queryType
    data
    results
    total
    annotation
    lastRefreshTime
    cacheStatus
    error { code message }
  }
}
Variables (= POST /query/result body)
{ "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.

‍

Errors

Request errors come back in errors, with the code in errorType. The codes are the same as REST:

Response200 OK
{
  "data": null,
  "errors": [
    {
      "errorType": "INVALID_QUERY",
      "message": "Unknown field googleAds.campaign_name.",
      "path": ["analyticsQuery"]
    }
  ]
}
  • A wrong type or an enum value that doesn’t exist (for example granularity: "hourly") fails GraphQL validation before the query runs, with errorType: "ValidationError". The same mistake through REST returns INVALID_QUERY.
  • An expired or missing token returns errorType: "UnauthorizedException". Refresh the token.
  • A query that fails after it starts returns status: FAILED with error, not an entry in errors.