GraphQL allows you to request exactly the data you need from BuildBetter. These queries help you fetch calls, signals, documents, and more.

Authentication

All GraphQL queries require authentication. Include your API key in the request header:
X-BuildBetter-Api-Key: YOUR_ORGANIZATION_API_KEY

Endpoint

POST https://api.buildbetter.app/graphql

Query Examples

Pagination

For large result sets, use pagination with limit and offset:
query GetCallsPaginated($limit: Int!, $offset: Int!) {
  interview(
    limit: $limit
    offset: $offset
    order_by: { started_at: desc }
  ) {
    id
    name
    started_at
  }
}

Filtering

Use the where clause to filter results:
query FilteredCalls {
  interview(
    where: {
      _and: [
        { started_at: { _gte: "2025-01-01" } }
        { attendees: { person: { email: { _eq: "john@example.com" } } } }
      ]
    }
  ) {
    id
    name
  }
}

Best Practices

  1. Request only needed fields - GraphQL returns only what you ask for
  2. Use variables - Makes queries reusable and secure
  3. Implement pagination - For large datasets
  4. Handle errors gracefully - Check for errors in responses
  5. Cache results - When appropriate for your use case