---
title: retrieve all stats for teams and developers
slug: retrieve-all-stats-for-teams-and-developers
docTags: 
createdAt: 2025-01-28T10:28:11.769Z
---

{
  "id": "0for68kYzrWqYICFt98a9",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.waydev.co/v2/stats",
    "name": "retrieve all stats for teams and developers",
    "description": "<p>By passing in the appropriate options, you can search for\navailable stats for your project account.\nHere you can find an example of the request body.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "kind": "required",
          "name": "Authorization",
          "type": "string",
          "description": "Your PAT generated in Waydev"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "metrics",
              "kind": "required",
              "type": "string",
              "description": "Array of metrics you want to receive from Waydev (JSON encoded).",
              "example": ""
            },
            {
              "name": "teams",
              "kind": "required",
              "type": "string",
              "description": "Array of teams you want to be included in the metrics (JSON encoded). You can get the teams list from the /teams endpoint. If you want to include all teams, pass '*' in this field.",
              "example": ""
            },
            {
              "name": "developers",
              "kind": "required",
              "type": "string",
              "description": "Array of developers you want to be included in the metrics (JSON encoded). If you want to include all teams, pass '*' in this field.",
              "example": ""
            },
            {
              "name": "timeframes",
              "kind": "required",
              "type": "string",
              "description": "Array of timeframes you want to be included in the metrics (JSON encoded). Available timeframes are: 'current' and 'past'.",
              "example": ""
            },
            {
              "name": "representations",
              "kind": "required",
              "type": "string",
              "description": "Here you have to specify how you want to receive your data grouped by: 'team', 'developer', 'general' (JSON encoded).",
              "example": ""
            },
            {
              "name": "period_start",
              "kind": "required",
              "type": "string",
              "description": "Start date of your analyzed period. Format: YYYY-MM-DD.",
              "example": ""
            },
            {
              "name": "period_end",
              "kind": "required",
              "type": "string",
              "description": "Start date of your analyzed period. Format: YYYY-MM-DD.",
              "example": ""
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful operation",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "bad input parameter",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "2S6q4LCGFastSfeuVcex6",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.waydev.co/v2/stats \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'authorization: string' \\\n     --data '{\n     \"metrics\": \"\",\n     \"teams\": \"\",\n     \"developers\": \"\",\n     \"timeframes\": \"\",\n     \"representations\": \"\",\n     \"period_start\": \"\",\n     \"period_end\": \"\"\n     }'"
        },
        {
          "id": "-5SeSiIib_2O-cogMK4hn",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"authorization\", \"string\");\n\nvar raw = JSON.stringify({\n   \"metrics\": \"\",\n   \"teams\": \"\",\n   \"developers\": \"\",\n   \"timeframes\": \"\",\n   \"representations\": \"\",\n   \"period_start\": \"\",\n   \"period_end\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.waydev.co/v2/stats\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "1VN1Py30GJKDLK2jQARf8",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.waydev.co/v2/stats\")\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[\"authorization\"] = \"string\"\nrequest.body = JSON.dump({\n   \"metrics\": \"\",\n   \"teams\": \"\",\n   \"developers\": \"\",\n   \"timeframes\": \"\",\n   \"representations\": \"\",\n   \"period_start\": \"\",\n   \"period_end\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "9jsPMlwXizGJyktyn2ZoQ",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.waydev.co/v2/stats\"\n\npayload = json.dumps({\n   \"metrics\": \"\",\n   \"teams\": \"\",\n   \"developers\": \"\",\n   \"timeframes\": \"\",\n   \"representations\": \"\",\n   \"period_start\": \"\",\n   \"period_end\": \"\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'authorization': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "2S6q4LCGFastSfeuVcex6"
    },
    "results": {
      "languages": [
        {
          "id": "OeD7xaiyj7kV0iXaP0UTX",
          "language": "200",
          "code": "// Successful operation\n"
        },
        {
          "id": "mw8Q_6xc1HksRC8fKhgd_",
          "language": "400",
          "code": "// bad input parameter\n"
        }
      ],
      "selectedLanguageId": "OeD7xaiyj7kV0iXaP0UTX"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}