---
title: Query Usage - GraphQL
slug: query-usage-graphql
docTags: 
createdAt: 2026-08-25T19:28:59.170Z
---

{
  "id": "7Sl-KQgP3oeBW2u-P5noN",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.nue.io/usage/async/graphql",
    "servers": [
      {
        "url": "https://api.nue.io/usage/async/graphql",
        "description": "Nue Production API Endpoint"
      },
      {
        "url": "https://api.sandbox.nue.io/usage/async/graphql",
        "description": "Nue Sandbox API Endpoint"
      }
    ],
    "name": "Query Usage - GraphQL",
    "description": "Execute GraphQL queries against usage data using POST method. The query is passed in the request body.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "optional",
          "name": "Content-Type",
          "type": "string",
          "description": "<p>Content type header (typically application/json)</p>"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "<p>GraphQL query, variables, and operation name</p>",
          "schema": [
            {
              "name": "query",
              "kind": "required",
              "type": "string",
              "description": "GraphQL query string"
            },
            {
              "name": "variables",
              "kind": "optional",
              "type": "object",
              "description": "GraphQL variables object",
              "example": "",
              "schema": []
            },
            {
              "name": "operationName",
              "kind": "optional",
              "type": "string",
              "description": "Name of the operation to execute"
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKeyAuth",
          "name": "nue-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "GraphQL query executed successfully",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>GraphQL response with data and/or errors</p>",
            "schema": [],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "QitdoRKS959ndjeTxx2WS",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.nue.io/usage/async/graphql \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"query\": \"\"\n     }'"
        },
        {
          "id": "2X_2qtAw0QwsU9Uh96uO6",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"query\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.nue.io/usage/async/graphql\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "XlfY8u0KsJ4alrH2z7atV",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/usage/async/graphql\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"query\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "nRVLh9yIi5iTuEYtQ09-_",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/usage/async/graphql\"\n\npayload = json.dumps({\n   \"query\": \"\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "QitdoRKS959ndjeTxx2WS"
    },
    "results": {
      "languages": [
        {
          "id": "mqp_goNn-4aE8X6RofrQ7",
          "language": "200",
          "code": "// GraphQL query executed successfully\n{}"
        }
      ],
      "selectedLanguageId": "mqp_goNn-4aE8X6RofrQ7"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}