---
title: Add Pipelines
slug: tp-api/add-pipelines
docTags: 
createdAt: 2023-12-26T14:37:58.070Z
---

{
  "id": "wTERHkuXzotnts5e1_yBC",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{url}}/api/portal/external/worker/{workerId}/add-pipeline",
    "servers": [
      {
        "url": "{{url}}/api/portal/external/worker/{workerId}/add-pipeline",
        "description": "Development environment"
      }
    ],
    "name": "Add Pipelines",
    "description": "This API is used to assign and match the pipelines that have been added to the system to kubernetes workers.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "workerId",
          "type": "string"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "array",
          "customType": "PipelineConfig[]",
          "schema": [
            {
              "name": "pipelineId",
              "kind": "optional",
              "type": "string",
              "example": ""
            }
          ],
          "modelRef": "#/components/schemas/PipelineConfig",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "cookieAuth",
          "name": "SESSION",
          "kind": "optional",
          "type": "apiKey",
          "in": "cookie"
        },
        {
          "id": "tokenAuth",
          "name": "X-XSRF-TOKEN",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "4i5nH-IacAEYt9sO21IA5",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/api/portal/external/worker/{workerId}/add-pipeline \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '[\n     {}\n     ]'"
        },
        {
          "id": "xg86R2iw6oPC42bnNElRr",
          "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   {}\n]);\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/api/portal/external/worker/{workerId}/add-pipeline\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "aG7EWgMeIPIc3JJW9XpiS",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/api/portal/external/worker/{workerId}/add-pipeline\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump([\n   {}\n])\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "L9jj615d_RmonUpdNsHLQ",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/api/portal/external/worker/{workerId}/add-pipeline\"\n\npayload = json.dumps([\n   {}\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": "4i5nH-IacAEYt9sO21IA5"
    },
    "results": {
      "languages": [
        {
          "id": "7F9ntIf_YLK1T-KibFgeU",
          "language": "200",
          "code": "// OK\n"
        }
      ],
      "selectedLanguageId": "7F9ntIf_YLK1T-KibFgeU"
    }
  },
  "children": [
    {
      "id": "J-rXH9407Q_KMYQXzoxNr",
      "type": "paragraph",
      "children": [
        {
          "text": "This API is used to assign and match the pipelines that have been added to the system to kubernetes workers.",
          "id": "hvsbXfXFkCcjW9hRVNjgi"
        }
      ]
    }
  ]
}