Skip to content
Start here

Create a Network Quality Test authorization token

POST/accounts/{account_id}/networkquality/token

Issues an authorization token for a Network Quality Test client.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Network Quality Write
Path ParametersExpand Collapse
account_id: string

Cloudflare account identifier.

Body ParametersJSONExpand Collapse
bytes: number

Customer-defined byte budget signed into the token for downstream enforcement and billing

exclusiveMinimum
maximum34359738368
minimum0
eyeball_id: string
source_ips: optional array of string
ReturnsExpand Collapse
errors: array of string
messages: array of string
result: object { token }
token: string
success: true

Create a Network Quality Test authorization token

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/networkquality/token \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    -d '{
          "bytes": 1,
          "eyeball_id": "eyeball-7f3a",
          "source_ips": [
            "203.0.113.42",
            "2001:db8::/32"
          ]
        }'
{
  "errors": [],
  "messages": [],
  "result": {
    "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6ImNmc3BlZWQrand0Iiwia2lkIjoiMDAwMDAwMDAtMDAwMC00MDAwLTgwMDAtMDAwMDAwMDAwMDAwIn0.eyJzdWIiOiIwMDAwMDAwMC0wMDAwLTQwMDAtODAwMC0wMDAwMDAwMDAwMDAiLCJleWViYWxsX2lkIjoiZXllYmFsbC03ZjNhIiwic291cmNlX2lwcyI6WyIyMDMuMC4xMTMuNDIiLCIyMDAxOmRiODo6LzMyIl0sImlzcyI6InVybjpjbG91ZGZsYXJlOmNmc3BlZWQtYXBpOnN0YWdpbmciLCJhdWQiOiJ1cm46Y2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