> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ebury.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute a GraphQL query over the webhooks API

The Webhooks API is using [GraphQL](https://graphql.org/).

This means that your queries will look like this:

1. in GraphQL (example #1)
2. as an HTTP POST request (example #2)

Your already existing infrastructure can be used to send HTTP requests as usual, and the response will be serialized as JSON data.
In addition, detailed data schema information is also provided, helpful to improve tooling on your side.


## OpenAPI

````yaml /openapi.json post /webhooks/graphql
openapi: 3.0.0
info:
  description: |
    Ebury API allows customers:
      to retrieve accounts, balances, beneficiaries, and transactions;
      to get buy/sell estimates and quotes, book trades and retrieve trade history;
      to allocate payments to a trade and beneficiary, and to submit payments in bulk;
      to download documents such as trade receipt, payment instruction and payment receipt;
      to manage the authorised persons on their account.
    The Metadata API allows applications to clarify some parts of the Ebury API
      that are impractical to express schematically.
  termsOfService: https://docs.ebury.io/#terms-of-use
  title: Ebury API
  version: '0.1'
servers:
  - url: https://{environment}.ebury.io
    variables:
      environment:
        default: api
        enum:
          - api
          - sandbox
security:
  - api_key: []
paths:
  /webhooks/graphql:
    post:
      tags:
        - Webhooks
      summary: Execute a GraphQL query over the webhooks API
      description: Execute a GraphQL query over the webhooks API
      parameters:
        - description: The ID of the client
          in: query
          name: client_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhooksRequest'
        description: Request Payload
        required: true
      responses:
        '200':
          description: Query was executed and the result is in the body
        '400':
          description: Invalid request
        '401':
          description: Access denied due to authentication failure
components:
  schemas:
    WebhooksRequest:
      properties:
        query:
          description: The GraphQL query
          type: string
        variables:
          description: The GraphQL variables
          type: string
      required:
        - query
      description: The GraphQL query to execute
      type: object
  securitySchemes:
    api_key:
      description: An API Key.
      in: header
      name: x-api-key
      type: apiKey

````