---
title: Send deployment data for computing DORA metrics
slug: send-deployment-data-for-computing-dora-metrics
docTags: 
createdAt: 2025-01-28T10:28:11.769Z
---

{
  "id": "0yQQSnPApXsmPwqB26P9B",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.waydev.co/v2/deployments",
    "name": "Send deployment data for computing DORA metrics",
    "description": "",
    "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": "The name is the only field required, the rest are optional. \nThe members to be included in the team need to pre exist in the database in order to include them in the team.",
          "schema": [
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "Deployment description. e.g. “deploy to production”",
              "example": ""
            },
            {
              "name": "repository_url",
              "kind": "required",
              "type": "string",
              "description": "URL of the repository. Must be the URL of a repo that is selected for processing within Waydev. e.g. https://github.com/{ORG_NAME}/{REPO_NAME}",
              "example": ""
            },
            {
              "name": "ref",
              "kind": "required",
              "type": "string",
              "description": "Ref of a merged PR that 'triggered' the deploy. Must be the full SHA of a merge commit that is detected by Waydev. A comma-separated list of refs is also accepted.",
              "example": ""
            },
            {
              "name": "start_date",
              "kind": "required",
              "type": "string<date-time>",
              "description": "Start date of the deployment.",
              "example": ""
            },
            {
              "name": "finished_date",
              "kind": "required",
              "type": "string<date-time>",
              "description": "End date of the deployment.",
              "example": ""
            },
            {
              "name": "env",
              "kind": "optional",
              "type": "string",
              "description": "Deployment environment. e.g. stable, dev, prod etc.",
              "example": ""
            },
            {
              "name": "result",
              "kind": "optional",
              "type": "string",
              "description": "Outcome of the deployment. e.g. failure, success, pending etc.",
              "example": ""
            },
            {
              "name": "state",
              "kind": "optional",
              "type": "string",
              "description": "State of the deployment. e.g. finished, in progress, waiting for manual input etc.",
              "example": ""
            },
            {
              "name": "number",
              "kind": "optional",
              "type": "integer",
              "description": "Unique identifier for the deployment. If it is not provided then one will be randomly generated.",
              "example": ""
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful operation",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "bad input parameter",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "Ij6Gp3_CaFTNt1ple6cuA",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.waydev.co/v2/deployments \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'authorization: string' \\\n     --data '{\n     \"name\": \"\",\n     \"repository_url\": \"\",\n     \"ref\": \"\",\n     \"start_date\": \"\",\n     \"finished_date\": \"\"\n     }'"
        },
        {
          "id": "IJCCJsy9HxY0jO5D5F2gT",
          "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   \"name\": \"\",\n   \"repository_url\": \"\",\n   \"ref\": \"\",\n   \"start_date\": \"\",\n   \"finished_date\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.waydev.co/v2/deployments\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "W6bXltofIJNSoxGEtO3-2",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.waydev.co/v2/deployments\")\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   \"name\": \"\",\n   \"repository_url\": \"\",\n   \"ref\": \"\",\n   \"start_date\": \"\",\n   \"finished_date\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "8_dAYnlxx1AcIWsufs5vs",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.waydev.co/v2/deployments\"\n\npayload = json.dumps({\n   \"name\": \"\",\n   \"repository_url\": \"\",\n   \"ref\": \"\",\n   \"start_date\": \"\",\n   \"finished_date\": \"\"\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": "Ij6Gp3_CaFTNt1ple6cuA"
    },
    "results": {
      "languages": [
        {
          "id": "kjsYlRvllgLxDANcLYQpG",
          "language": "200",
          "code": "// Successful operation\n"
        },
        {
          "id": "zed2YHLccpzOA2zBlH9o7",
          "language": "401",
          "code": "// bad input parameter\n"
        }
      ],
      "selectedLanguageId": "kjsYlRvllgLxDANcLYQpG"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}