API basics

Last updated: Nov 4, 2026


On the Fluid Attacks platform, you can make requests to its GraphQL API. Before you do that, get some basic knowledge of this query language.

Then, use this guide. It tells you how to authenticate and how to start to explore the API.

Authenticate to use the API

You can authenticate to the Fluid Attacks API from the GraphiQL playground or by HTTP requests in code. This guide tells you about two ways to authenticate in the GraphiQL playground.

Authentication with Fluid Attacks' platform login

You can authenticate with the login of the Fluid Attacks platform:

  1. Log in to the platform.
  2. Access the API.

Then, write your queries. Click the play icon to run them.

Query the Fluid Attacks API

Authentication with Fluid Attacks' platform API token

You can authenticate to the Fluid Attacks API with a token, which you add on the Fluid Attacks platform. Do the steps below.

  1. Log in to the Fluid Attacks platform at app.fluidattacks.com.

  2. Click the user menu.

  3. Select the API token option.

    Find the API Token option on the Fluid Attacks platform
  4. In the pop-up window, click Add token.

    Add API token on the Fluid Attacks platform
  5. Type a name for your token.

  6. Select an expiration date for your token (a maximum of six months from the current date).

    Generate API token on the Fluid Attacks platform
  7. Click Confirm. The window shows your token as asterisks. If you want, click View to show it.

    Copy API token on the Fluid Attacks platform
  8. Click Copy. Keep this token in a safe location. After you close the pop-up window, the platform does not show it again. When the copy is successful, the platform shows a message for a short time.

    Get token copied message on the Fluid Attacks platform
  9. Go to the GraphiQL playground.

  10. Select the Headers tab at the bottom.

    Authenticate to the Fluid Attacks API with token
  11. In Headers, type {"authorization":"Bearer YOUR_TOKEN_GOES_HERE"}. (Replace YOUR_TOKEN_GOES_HERE with your token.)

  12. Write your GraphQL queries in the top area.

  13. Click the play icon to run them.

Examples of a simple query

These examples show how to make a simple query to the Fluid Attacks API with Python, JavaScript, and Bash. This query gets the username and email of the current user.

All the examples use the POST method to send the GraphQL query to the API endpoint. To learn about this method, read the official GraphQL documentation.

Python

import requests
query = """
{
  me {
    userName
    userEmail
  }
}
"""
token = "YOUR_TOKEN_GOES_HERE"

response = requests.post(
  "https://app.fluidattacks.com/api",
  json={"query": query},
  headers={"authorization": f"Bearer {token}"},
)
print(response.json())

JavaScript

const response = await fetch("https://app.fluidattacks.com/api", {
  headers: {
    "content-type": "application/json",
    authorization: "Bearer YOUR_TOKEN_GOES_HERE",
  },
  body: JSON.stringify({ query: "{ me { userName userEmail }}" }),
  method: "POST",
});
console.log(await response.json());

Bash

curl \
  --request POST \
  --url https://app.fluidattacks.com/api \
  --header "content-type: application/json" \
  --header "authorization: Bearer YOUR_TOKEN_GOES_HERE" \
  --data '{"query": "{ me { userName userEmail }}"}'

Revoke API token

If an API token expired or if you cannot find it, you can revoke it. To revoke the token, follow these steps:

  1. Log in to the Fluid Attacks platform at app.fluidattacks.com.

  2. Click the user menu.

  3. Select API token.

  4. Click Revoke.

    Revoke API token on the Fluid Attacks platform

    If you revoke an active token that you used in the past seven days, a warning message shows the last time that you used it.

    Revoke a valid API token on the Fluid Attacks platform
  5. Click Confirm.

Access playground docs

The GraphiQL playground has built-in documentation to help you explore the API:

  1. Go to the API page.

  2. Click the book icon on the left side of the playground.

    Find the Fluid Attacks API documentation
  3. Examine the available queries, mutations, and schema types.

    Browse the Fluid Attacks API documentation

Paginated fields

The Fluid Attacks API uses paginated and non-paginated lists. Non-paginated lists give all the available results directly, as a normal list, between square brackets. The screenshot below shows an example.

Get non paginated lists on the Fluid Attacks API

Paginated lists, which usually have the suffix Connection, give only a specified number of results and a "cursor". You can include this cursor in the next requests to go to the next pages.

See paginated fields on the Fluid Attacks API

Remember these differences when you build integrations that must get all the information in a paginated field. For more information, read the official pagination documentation of GraphQL.

Paginated fields give a maximum of 500 results for each request. If you ask for more than 500 results, the API returns an error and no data. Thus, ask for 500 results or fewer for each page. Then, use the cursor to get the next page.

This example helps you understand pagination. It gets the first ten vulnerabilities of a group with the name Narrabri. The screenshot below shows the query.

Retrieve vulnerabilities on the Fluid Attacks API

Examine the terminal. If there is a next page, the last item of the query shows hasNextPage and endCursor. hasNextPage tells you that there is a next page, and endCursor gives its cursor token.

Get cursor on the Fluid Attacks API

To see the next page, give the cursor token as the after argument in your next query.

Use the after argument on the Fluid Attacks API

Continue to send requests with the updated after argument until hasNextPage is false. This value tells you that you got all the pages. Read other examples in the GraphQL documentation.

Rate limits

The Fluid Attacks API has a rate limit that is different for each authentication method. Requests with token authentication get a much higher limit. If you go above this limit, you get an HTTP 429 (Too Many Requests) error response. The response includes a retry-after header. This header tells you how long to wait before you send another request.

This Python script shows how to control this condition:

import requests
from time import sleep
query = """
{
  me {
    userName
    userEmail
  }
}
"""
token = ""
def request():
    while True:
        response = requests.post(
          "https://app.fluidattacks.com/api",
          json={"query": query},
          headers={"authorization": f"Bearer {token}"},
        )
        if response.status_code == 429:
            seconds = response.headers["retry-after"]
            sleep(seconds + 1)
        else:
            break
    return response
response = request()
print(response.json())

This solution can be different for each HTTP client library or language. Fluid Attacks also recommends that you wait one more second than the value of the header.

Temporary network errors

The Fluid Attacks API can sometimes have temporary network problems, for example, timeouts because of high demand, or connection failures.

To make your integration more resilient, add a retry mechanism for failed requests. This mechanism is very important for mission-critical processes that use the API. This Python script is a small example:

MAX_RETRIES = 10

def request():
    while True:
        response = requests.post(
            "https://app.fluidattacks.com/api",
            json={"query": query},
            headers={"authorization": f"Bearer {token}"},
        )

        if response.status_code == 429:
            seconds = response.headers["retry-after"]
            sleep(seconds + 1)
        elif response.status_code >= 500:
            retries += 1
            if retries == MAX_RETRIES:
                break
            sleep(retries)
        else:
            break

    return response

This solution can be different for each HTTP client library or language.

Fluid Attacks' platform API response status

The Fluid Attacks platform API uses standard HTTP status codes to show the success or failure of your requests. These are some of the most frequent codes:

Status codeDescription
200OK: The API processed the request. To learn more about the structure of the response body, read the GraphQL documentation.
400Bad request: The request has a syntax error, or its format is not correct. For details about the error, examine the response body. For the correct query syntax, read the GraphQL documentation.
429Too many requests: You went above the API rate limit. Send fewer requests, or add a retry mechanism that obeys the retry-after header value (in seconds) of the response.
502-504Bad Gateway/Gateway Timeout: These errors usually show temporary server problems or network problems. Add a retry mechanism to your code. If the errors continue, contact [email protected].

Response times

With GraphQL, you can request a large quantity of data in one request, but the response time increases with the quantity of data. Thus, you can divide your queries into different requests when it is necessary.

On this page