Getting Started with Zuper GraphQL API (Beta)

The Zuper GraphQL API (ZuperQL) lets you read and write Zuper data with GraphQL. Use it alongside the REST API, with the same API key.

Beta: The GraphQL API is in beta. Types, fields and limits may change before it becomes generally available. Changes will be announced in the changelog.

With GraphQL, a single request can:

  • Return only the fields you ask for, so responses stay small.
  • Pull in related records, such as a job with its customer, property, estimates and invoices, without extra calls.
  • Filter, sort and paginate lists.
  • Run several queries at once, for example today's jobs, pending estimates and unpaid invoices for a dashboard.

The GraphQL API covers these modules:

ModuleQueriesMutations
Jobsjob, jobscreateJob, updateJob, updateJobStatus, updateJobSchedule, updateJobAssignment, deleteJob
Customerscustomer, customerscreateCustomer, updateCustomer, deleteCustomer
Organizationsorganization, organizationscreateOrganization, updateOrganization, deleteOrganization
Propertiesproperty, propertiescreateProperty, updateProperty, deleteProperty
Estimatesestimate, estimatescreateEstimate, updateEstimate, deleteEstimate
Invoicesinvoice, invoicescreateInvoice, updateInvoice, deleteInvoice
Current userviewer—

Note: All API requests should be sent only through HTTPS.


Endpoint

All GraphQL requests go to a single endpoint on your account's Base API URL:

POST {dc_api_url}/api/zuperql

For example, if your Base API URL is https://us-west-1c.zuperpro.com, the endpoint is https://us-west-1c.zuperpro.com/api/zuperql.

Your Base API URL depends on the data center that hosts your account. To find it, see What is my Base API URL?.


Authentication

The GraphQL API uses the same API keys as the REST API. Send your key in the x-api-key header. To create a key, see Generating API Key.

HeaderValue
x-api-keyYour API key
Content-Typeapplication/json

Your account and user come from the API key. You never pass a company or account ID in a query, and you can only read or change your own account's data.

Note: A key created as Read-only can run queries but not mutations. A mutation sent with a read-only key fails with the error code FORBIDDEN.


Request format

Every request is an HTTP POST with a JSON body:

PropertyRequiredDescription
queryYesThe GraphQL query or mutation
variablesNoA JSON object with the values for the variables declared in query
operationNameNoThe operation to run, when query contains more than one named operation

Always pass values through variables rather than writing them into the query string. Your queries stay reusable, and you don't have to escape quotes.


Make your first request

The viewer query returns the user that your API key belongs to. It's a quick way to check your key and endpoint.

curl --request POST 'https://us-west-1c.zuperpro.com/api/zuperql' \
  --header 'x-api-key: <your-api-key>' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "query": "query Viewer { viewer { id first_name last_name email designation } }",
    "variables": {}
  }'
{
  "data": {
    "viewer": {
      "id": "c4a1f5e0-6f2b-11ee-9a6e-3d1b0c8e2f11",
      "first_name": "Jane",
      "last_name": "Cooper",
      "email": "[email protected]",
      "designation": "Operations Manager"
    }
  },
  "extensions": {
    "cost": { "requested": 6, "available": 5994, "max_query_cost": 2000 }
  }
}

Next, fetch the five most recently created jobs with their customer:

query RecentJobs($first: Int) {
  jobs(first: $first, sort: { field: CREATED_AT, direction: DESC }) {
    nodes {
      id
      work_order_number
      job_title
      current_status { status_name }
      customer { customer_full_name customer_email }
    }
    page_info { has_next_page end_cursor }
  }
}
{ "first": 5 }
curl --request POST 'https://us-west-1c.zuperpro.com/api/zuperql' \
  --header 'x-api-key: <your-api-key>' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "query": "query RecentJobs($first: Int) { jobs(first: $first, sort: { field: CREATED_AT, direction: DESC }) { nodes { id work_order_number job_title current_status { status_name } customer { customer_full_name customer_email } } page_info { has_next_page end_cursor } } }",
    "variables": { "first": 5 }
  }'

Note: The examples in these guides show the GraphQL operation and its variables separately. To send any of them, put the operation in query and the variables in variables, as shown above. In a terminal, keep the single quotes around --data-raw so the shell doesn't expand GraphQL variables such as $first.


Conventions

  • Field names use snake_case and match the field names in the REST API, for example job_title and customer_email.
  • id is the record's UID (job_uid, customer_uid and so on), the same UID used by the REST API.
  • References in filters and inputs end in _uid, for example customer_uid and category_uid.
  • Dates and times (DateTime) are UTC, ISO 8601 combined date-time strings, for example 2026-11-20T04:30:00Z. A date without a time, such as 2026-11-20, is rejected.
  • Date-only fields (estimate_date, expiry_date, invoice_date, due_date): send the date at noon UTC, for example 2026-11-20T12:00:00Z. Zuper applies your account's time zone to these fields, so a midnight UTC value can show up as the previous day for accounts west of UTC.
  • Deleted records are excluded from lookups and lists.
  • Custom fields include a hidden flag that follows the visibility rules in your account. It's true for fields hidden from field executives when your API key belongs to a field executive, and for fields your access role has no access to. The value is still returned, so hide these fields in your own app.

Exploring the schema

The endpoint supports standard GraphQL introspection. Point a GraphQL client such as Postman, Insomnia or a code generator at the endpoint with your x-api-key header, and it loads the full schema, including every type, field, argument and enum value.


Next steps


Did this page help you?