---
title: "Create a DevOps project pipeline"
method: POST
path: "/kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines"
tags: ["DevOps Pipeline"]
---

# Create a DevOps project pipeline

`POST /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines`

## Path parameters

- `devops` string, required

## Request body

- DevopsProjectPipeline
  - `multi_branch_pipeline` DevopsMultiBranchPipeline
    - `bitbucket_server_source` DevopsBitbucketServerSource
      - `api_uri` string — The api url can specify the location of the github apiserver.For private cloud configuration
      - `credential_id` string — credential id to access github source
      - `discover_branches` integer — Discover branch configuration
      - `discover_pr_from_forks` DevopsDiscoverPRFromForks
        - `strategy` integer — github discover startegy
        - `trust` integer — trust user type
      - `discover_pr_from_origin` integer — Discover origin PR configuration
      - `git_clone_option` DevopsGitCloneOption
        - `depth` integer — git clone depth
        - `shallow` boolean — Whether to use git shallow clone
        - `timeout` integer — git clone timeout mins
      - `owner` string — owner of github repo
      - `regex_filter` string — Regex used to match the name of the branch that needs to be run
      - `repo` string — repo name of github repo
      - `scm_id` string — uid of scm
    - `descriptio` string — description of pipeline
    - `discarder` DevopsDiscarderProperty
      - `days_to_keep` string — days to keep pipeline
      - `num_to_keep` string — nums to keep pipeline
    - `git_source` DevopsGitSource
      - `credential_id` string — credential id to access git source
      - `discover_branches` boolean — Whether to discover a branch
      - `git_clone_option` DevopsGitCloneOption
        - `depth` integer — git clone depth
        - `shallow` boolean — Whether to use git shallow clone
        - `timeout` integer — git clone timeout mins
      - `regex_filter` string — Regex used to match the name of the branch that needs to be run
      - `scm_id` string — uid of scm
      - `url` string — url of git source
    - `github_source` DevopsGithubSource
      - `api_uri` string — The api url can specify the location of the github apiserver.For private cloud configuration
      - `credential_id` string — credential id to access github source
      - `discover_branches` integer — Discover branch configuration
      - `discover_pr_from_forks` DevopsDiscoverPRFromForks
        - `strategy` integer — github discover startegy
        - `trust` integer — trust user type
      - `discover_pr_from_origin` integer — Discover origin PR configuration
      - `git_clone_option` DevopsGitCloneOption
        - `depth` integer — git clone depth
        - `shallow` boolean — Whether to use git shallow clone
        - `timeout` integer — git clone timeout mins
      - `owner` string — owner of github repo
      - `regex_filter` string — Regex used to match the name of the branch that needs to be run
      - `repo` string — repo name of github repo
      - `scm_id` string — uid of scm
    - `multibranch_job_trigger` DevopsMultiBranchJobTrigger
      - `create_action_job_to_trigger` string — pipeline name to trigger
      - `delete_action_job_to_trigger` string — pipeline name to trigger
    - `name` string, required — name of pipeline
    - `script_path` string, required — script path in scm
    - `single_svn_source` DevopsSingleSvnSource
      - `credential_id` string — credential id to access svn source
      - `remote` string — remote address url
      - `scm_id` string — uid of scm
    - `source_type` string, required — type of scm, such as github/git/svn
    - `svn_source` DevopsSvnSource
      - `credential_id` string — credential id to access svn source
      - `excludes` string — branches do not run pipeline
      - `includes` string — branches to run pipeline
      - `remote` string — remote address url
      - `scm_id` string — uid of scm
    - `timer_trigger` DevopsTimerTrigger
      - `cron` string — jenkins cron script
      - `interval` string — interval ms
  - `pipeline` DevopsNoScmPipeline
    - `descriptio` string — description of pipeline
    - `disable_concurrent` boolean — Whether to prohibit the pipeline from running in parallel
    - `discarder` DevopsDiscarderProperty
      - `days_to_keep` string — days to keep pipeline
      - `num_to_keep` string — nums to keep pipeline
    - `jenkinsfile` string — Jenkinsfile's content'
    - `name` string, required — name of pipeline
    - `parameters` DevopsParameter[] — Parameters define of pipeline,user could pass param when run pipeline
      - `default_value` string — default value of param
      - `description` string — description of pipeline
      - `name` string, required — name of param
      - `type` string, required — type of param
    - `remote_trigger` DevopsRemoteTrigger
      - `token` string — remote trigger token
    - `timer_trigger` DevopsTimerTrigger
      - `cron` string — jenkins cron script
      - `interval` string — interval ms
  - `type` string, required — type of devops pipeline, in scm or no scm

## Response `200`

ok

- DevopsProjectPipeline
  - `multi_branch_pipeline` DevopsMultiBranchPipeline
    - `bitbucket_server_source` DevopsBitbucketServerSource
      - `api_uri` string — The api url can specify the location of the github apiserver.For private cloud configuration
      - `credential_id` string — credential id to access github source
      - `discover_branches` integer — Discover branch configuration
      - `discover_pr_from_forks` DevopsDiscoverPRFromForks
        - `strategy` integer — github discover startegy
        - `trust` integer — trust user type
      - `discover_pr_from_origin` integer — Discover origin PR configuration
      - `git_clone_option` DevopsGitCloneOption
        - `depth` integer — git clone depth
        - `shallow` boolean — Whether to use git shallow clone
        - `timeout` integer — git clone timeout mins
      - `owner` string — owner of github repo
      - `regex_filter` string — Regex used to match the name of the branch that needs to be run
      - `repo` string — repo name of github repo
      - `scm_id` string — uid of scm
    - `descriptio` string — description of pipeline
    - `discarder` DevopsDiscarderProperty
      - `days_to_keep` string — days to keep pipeline
      - `num_to_keep` string — nums to keep pipeline
    - `git_source` DevopsGitSource
      - `credential_id` string — credential id to access git source
      - `discover_branches` boolean — Whether to discover a branch
      - `git_clone_option` DevopsGitCloneOption
        - `depth` integer — git clone depth
        - `shallow` boolean — Whether to use git shallow clone
        - `timeout` integer — git clone timeout mins
      - `regex_filter` string — Regex used to match the name of the branch that needs to be run
      - `scm_id` string — uid of scm
      - `url` string — url of git source
    - `github_source` DevopsGithubSource
      - `api_uri` string — The api url can specify the location of the github apiserver.For private cloud configuration
      - `credential_id` string — credential id to access github source
      - `discover_branches` integer — Discover branch configuration
      - `discover_pr_from_forks` DevopsDiscoverPRFromForks
        - `strategy` integer — github discover startegy
        - `trust` integer — trust user type
      - `discover_pr_from_origin` integer — Discover origin PR configuration
      - `git_clone_option` DevopsGitCloneOption
        - `depth` integer — git clone depth
        - `shallow` boolean — Whether to use git shallow clone
        - `timeout` integer — git clone timeout mins
      - `owner` string — owner of github repo
      - `regex_filter` string — Regex used to match the name of the branch that needs to be run
      - `repo` string — repo name of github repo
      - `scm_id` string — uid of scm
    - `multibranch_job_trigger` DevopsMultiBranchJobTrigger
      - `create_action_job_to_trigger` string — pipeline name to trigger
      - `delete_action_job_to_trigger` string — pipeline name to trigger
    - `name` string, required — name of pipeline
    - `script_path` string, required — script path in scm
    - `single_svn_source` DevopsSingleSvnSource
      - `credential_id` string — credential id to access svn source
      - `remote` string — remote address url
      - `scm_id` string — uid of scm
    - `source_type` string, required — type of scm, such as github/git/svn
    - `svn_source` DevopsSvnSource
      - `credential_id` string — credential id to access svn source
      - `excludes` string — branches do not run pipeline
      - `includes` string — branches to run pipeline
      - `remote` string — remote address url
      - `scm_id` string — uid of scm
    - `timer_trigger` DevopsTimerTrigger
      - `cron` string — jenkins cron script
      - `interval` string — interval ms
  - `pipeline` DevopsNoScmPipeline
    - `descriptio` string — description of pipeline
    - `disable_concurrent` boolean — Whether to prohibit the pipeline from running in parallel
    - `discarder` DevopsDiscarderProperty
      - `days_to_keep` string — days to keep pipeline
      - `num_to_keep` string — nums to keep pipeline
    - `jenkinsfile` string — Jenkinsfile's content'
    - `name` string, required — name of pipeline
    - `parameters` DevopsParameter[] — Parameters define of pipeline,user could pass param when run pipeline
      - `default_value` string — default value of param
      - `description` string — description of pipeline
      - `name` string, required — name of param
      - `type` string, required — type of param
    - `remote_trigger` DevopsRemoteTrigger
      - `token` string — remote trigger token
    - `timer_trigger` DevopsTimerTrigger
      - `cron` string — jenkins cron script
      - `interval` string — interval ms
  - `type` string, required — type of devops pipeline, in scm or no scm

## Other responses

- `default` — ok

## Changes

- **2019-08-27** `6d6e730a2d14` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/kubesphere/apis/ks-api/changes/kapis/devops.kubesphere.io/v1alpha2/devops/:devops/pipelines/post.md)

---

[API](https://skmtc.dev/kubesphere/apis/ks-api.md) · [All operations](https://skmtc.dev/kubesphere/apis/ks-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kubesphere/ks-api/revisions/6cef28dc0ade/schema)
