Last updated: 2025-08-14

This document is targeted at Swat.io customers who have been granted access to our GraphQL API.

If you are reading this document, it means you have been given access. Otherwise, please contact your sales representative or get in touch with [email protected] .

Overview

Quick start

Fill in the <TOKEN> you received below and you should receive back your user ID in Swat.io!

curl -s \\
    -X POST \\
    --location "<https://graphql.swatio.app/api>" \\
    -H "content-type: application/json; charset=UTF-8" \\
    -H "Authorization: Bearer <TOKEN>" \\
    -d '{
          "query": "query whoAmI { me { id } }",
          "variables": null
        }'

Example result:

{
  "data": {
    "me": {
      "id": "<your user id>",
    }
  },
  "meta": {
    "x-swatio-trace-id": "…"
  }
}

Client compatibility

Our GraphQL does not require or limit to any specific client nor do we provide a SDK. You can use curl, your favorite programming language or desktop applications like https://www.usebruno.com/ or https://www.postman.com/ .

Please note that web-based clients are likely not to work due to security restrictions (CORS) we have put in place.

It’s highly recommended to use any of the desktop clients, that support introspection, provide in-app documentation and autocomplete, and take care of the correct encoding (GraphQL, JSON) structure necessary for the GraphQL server to accept the request.

Relevancy of the x-swatio-trace-id

Every response from the GraphQL API returns a field meta.x-swatio-trace-id in the response.

If you are experiencing problems or think you found a bug, please contact us at [email protected] and always provide us with the trace ID. This will speed up the analysis on our side.