Skip to main content

How to Use the GraphQL API for Reporting and Exports

Retrieve your Ventrata data with the GraphQL API, selecting exactly the fields, filters and totals you need.

The GraphQL API gives you programmatic access to the data in your Ventrata Dashboard tables. You can:

  • request only the fields you need

  • include related records, such as a booking's product, in the same request

  • group records and calculate totals, such as sums and averages

  • page through large result sets

The GraphQL API is the preferred way to access your own Ventrata data, particularly for reporting, exports and Dashboard mode connections. It replaces the deprecated Reporting and Export API endpoints (/ventrata/dashboard/report and /ventrata/dashboard/export). Use it for all new reporting and export integrations.

📒 NOTE

Reseller and checkout integrations continue to use the OCTO API. This article does not apply to them.

For the full schema, field descriptions and more examples, see the Ventrata GraphQL API documentation.


Manage API Keys

Requests to the GraphQL API are authenticated with an API key. You create, rotate and delete API keys on the API keys tab of your Ventrata Dashboard.

Prerequisites:

  • You are an admin user of your Ventrata account.

Create an API Key

Create an API key to authenticate your requests.

‼️ IMPORTANT

Your API key is a confidential credential that provides access to your Ventrata account. Never share it with anyone over chat or email.

  1. In the Ventrata Dashboard, go to [user_name] > Account Settings.

    Account Settings

  2. Press the API Keys tab.

    API Keys

  3. In the action bar, press the Create API Key button.

    Create API Key

  4. Enter a name for the API key.

    Name

  5. Select the resource permissions you need.

    Resource Permissions

    📗 TIP

    Typically, a resource has read and write permissions. Browse the full list of resources in the Ventrata REST Documentation.

  6. Press the Create API Key button.

    Create API Key

  7. Copy the key and store it securely.

    Copy API Key

    ‼️ IMPORTANT

    The API key is shown only once, when you create it. If you lose it, create a new key.


Rotate an API Key

Rotating replaces an API key with a new one. The old key keeps working until you delete it, so you can update your integration before you switch the old key off.

Rotate a key when:

  • the key may have been exposed, for example, sent over chat or email, saved in source control, or written to a log

  • someone who had access to the key leaves your organisation or no longer works on the integration

  • your organisation's security policy requires regular rotation

  1. In the Ventrata Dashboard, go to [user_name] > Account Settings.

    Account Settings

  2. Press the API Keys tab.

    API Keys

  3. Find the key and press the Rotate button.

    Rotate

  4. Check the 'Name' and 'Resource permissions' fields.

    They are copied from the old key, you can change them.

    Name & Resource Permissions

  5. Press the Rotate API Key button.

    Rotate API Key

  6. Copy the new key and store it securely.

    Copy New Key

  7. Update your integration to use the new key, and test that it works.

  8. Delete the old key. Either:

    • press the Delete old key button in the same window, or

      Delete Old Key


    • press Close and delete the old key later from the API Keys tab.

      Delete

    ‼️ IMPORTANT

    Update your integration before you delete the old key. Services that still use the old key stop working as soon as it is deleted.


Delete an API Key

Delete an API key when an integration no longer needs access, or to switch off a key immediately.

  1. In the Ventrata Dashboard, go to [user_name] > Account Settings.

    Account Settings

  2. Press the API Keys tab.

    API Keys

  3. Find the key and press the Delete button.

    Delete

  4. Press the Delete button in the pop-up window to confirm.

    Confirm

    ‼️ IMPORTANT

    Deleting a key cannot be undone. Services that use the key lose access immediately.


Choose an Endpoint

Query data for your account or supplier data for your region. All requests are POST requests to one of these endpoints.

Data

Endpoint

Your account, users and roles

https://api.ventrata.com/graphql

Supplier data (bookings, tickets, transactions, etc.) for suppliers in the US region

https://api.ventrata.com/us1/graphql

Supplier data (bookings, tickets, transactions, etc.) for suppliers in the Europe region

https://api.ventrata.com/eu1/graphql

📗 TIP

To locate your region, check your Dashboard URL. The region appears after the first / following the domain, for example dashboard.ventrata.com/us1/... or dashboard.ventrata.com/eu1/....

📗 TIP

The 'View GraphQL Query' option shows the correct endpoint for your data. See Get a Query from the Dashboard.

GraphQL Query


Required Headers

Send these headers with every request.

Header

Description

Authorization: Bearer YOUR_SECRET_TOKEN

Authenticates the request

Content-Type: application/json

Indicates a JSON payload


Test Your API Key

Send the whoami query to the account endpoint to check that your API key works.

📘 EXAMPLE

curl https://api.ventrata.com/graphql \
-H "Authorization: Bearer YOUR_SECRET_TOKEN" \
-H "Content-Type: application/json" \
--data '{"query":"{ whoami { user { id name email } account { id name } } }"}'

The response returns the account linked to your API key in data.whoami.account. For an API key, user is null.


Get a Query from the Dashboard

The quickest way to build a request is to copy it from the Dashboard.

The query includes the columns, filters and sorting you have applied.

  1. In your Ventrata Dashboard, go to any data table, for example, Bookings or Transactions.

  2. Apply the columns and filters you need.

  3. Do one of the following:

    • For raw data, press the Export button and select 'View GraphQL Query'.

      Export


    • For a report, generate the report and press the View GraphQL Query button on the report.

      Report

  4. Press the Copy request body button.

    Copy Request Body

  5. Send the copied body as a POST request to the endpoint shown in the dialog. In the Authorization header, replace YOUR_SECRET_TOKEN with your API key.

    Query Header

📒 NOTE

  • The query runs with your API key's permissions, not your Dashboard user's. If the results differ from what you see in the Dashboard, check the API key's permissions.

  • Results are returned in pages. To retrieve every row, follow the pagination steps in the GraphQL API documentation.


Differences from the Reporting and Export API Endpoints

If you use /ventrata/dashboard/report or /ventrata/dashboard/export, these are the main differences.

Reporting and Export API endpoints

GraphQL API

Credential

API key of a Dashboard mode connection

API key from the API Keys tab

Headers

  • Authorization

  • Content-Type

  • Octo-Capabilities: ventrata/dashboard

  • Authorization

  • Content-Type

Endpoint

https://api.ventrata.com/octo/ventrata/dashboard/report or .../export

https://api.ventrata.com/us1/graphql or .../eu1/graphql

Build a request

No longer available

'Reporting API cURL' / 'Download Export API cURL'

'View GraphQL Query' > Copy request body

Columns

original (legacy) dataset and column names

current field names

Results

all rows in one response

paged results

Did this answer your question?