All Products
Search
Document Center

Alibaba Cloud DevOps:CreateServiceConnection - Create a service connection

Last Updated:Jul 10, 2026

Create a service connection using OpenAPI.

Endpoint and authorization information

Product

Resource

Required permission

Pipeline

Service connection

Read and write

Request syntax

Region edition

POST https://{domain}/oapi/v1/flow/createServiceConnection

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example value

-

object

body

No

authId

integer

body

No

Service authorization ID.

111

authType

string

body

No

Service authorization type.

CREDENTIAL (service certificate); AUTHENTICATION (service authorization)

connectionName

string

body

No

Service connection name.

ECS connection

connectionType

string

body

No

Service connection type.
Central edition: ecs Elastic Compute Service (ECS); Gitee; Github; docker_register_aliyun Container Registry (ACR); ack Container Service for Kubernetes (ACK); Codeup Apsara DevOps Codeup; oss Object Storage Service (OSS); edas Enterprise Distributed Application Service (EDAS); sae Serverless App Engine (SAE); ros Resource Orchestration Service (ROS); fc Function Compute (FC); emas Multiexperience Development Platform EMAS; PACKAGES Apsara DevOps Packages; customGitlab self-hosted GitLab; git generic Git; gitlab GitLab; bitbucket Bitbucket; jenkins Jenkins; private_docker_registry private image repository; ess Auto Scaling (ESS); atomGit AtomGit; svn SVN; gitlabAPI self-hosted GitLab (API V4 or later); vpc virtual private cloud (VPC).
Region edition: ecs Elastic Compute Service (ECS); Github; docker_register_aliyun Container Registry (ACR); ack Container Service for Kubernetes (ACK); Codeup Apsara DevOps Codeup; oss Object Storage Service (OSS); sae Serverless App Engine (SAE); PACKAGES Apsara DevOps Packages; customGitlab self-hosted GitLab; git generic Git; gitlab GitLab; bitbucket Bitbucket; private_docker_registry private image repository; gitlabAPI self-hosted GitLab (API V4 or later); vpc virtual private cloud (VPC).




ecs

scope

string

body

No

Visibility scope of the service connection.

PERSON (private); GLOBAL (public); CUSTOM (custom)

Request examples

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/flow/createServiceConnection' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "authId": 111,
        "authType": "CREDENTIAL (service certificate); AUTHENTICATION (service authorization)",
        "connectionName": "ECS connection",
        "connectionType": "ecs",
        "scope": "PERSON (private); GLOBAL (public); CUSTOM (custom)"
    }'

Response parameters

Parameter

Type

Description

Example value

-

integer

Service connection ID.

19224

Response example

19224

Error codes

For API error codes, see the Error Code Center.