All Products
Search
Document Center

API Gateway:CreateService

Last Updated:Mar 30, 2026
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Creates a service.

Operation description

create multiple services at a time.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation Access level Resource type Condition key Associated operation
apig:CreateService none
*Service
acs:apig:{#regionId}:{#accountId}:service/*
    none
none

Request syntax

POST /v1/services HTTP/1.1

Request parameters

Parameter Type Required Description Example
body object No

The request body.

gatewayId string No

The gateway instance ID.

gw-cq7l5s5lhtg***
sourceType string No

The service source type. Valid values:

  • MSE_NACOS: MSE Nacos instance services
  • K8S: Container Service for Kubernetes (ACK) cluster services
  • VIP: fixed IP addresses
  • DNS: Domain Name System (DNS) domains
  • FC3: Function Compute services
  • SAE_K8S_SERVICE: Serverless App Engine (SAE) Kubernetes services

Valid values:

  • SAE_K8S_SERVICE
  • K8S
  • FC3
  • DNS
  • VIP
  • MSE_NACOS
MSE_NACOS
serviceConfigs array<object> No

The list of service configurations.

object No

A service configuration.

name string No

The service name.

user-service
namespace string No

The service namespace. This parameter is required when sourceType is set to K8S or MSE_NACOS.

  • If sourceType is set to K8S, this parameter specifies the namespace where the K8s service resides.
  • If sourceType is set to MSE_NACOS, this parameter specifies a namespace in Nacos.

This parameter is required if sourceType is set to K8S or MSE_NACOS.

PUBLIC
groupName string No

The service group name. This parameter is required if sourceType is set to MSE_NACOS.

DEFAULT_GROUP
addresses array No

The list of domain names or fixed IP addresses.

string No

A domain name or fixed IP address.

dev.com:8080
qualifier string No

The function version/alias.

LATEST
aiServiceConfig AiServiceConfig No

The AI service configurations.

agentServiceConfig AgentServiceConfig No

Agent service configuration

dnsServers array No

The list of DNS service addresses.

string No

A DNS service address.

100.100.2.136:53
sourceId string No

Service source ID

nacos-instance-001
validationOptions object No

Validation options

skipVerifyAIChatCompletion boolean No

Skip AI chat completion verification

expressType string No

Express type

Standard
resourceGroupId string No

The resource group ID.

rg-xxx
clientToken string No

clientToken

xxx

Response parameters

Parameter Type Description Example
object

Schema of Response

requestId string

The request ID.

C67DED2B-F19B-5BEC-88C1-D6EB854CD0D4
code string

The status code.

Ok
message string

The returned message.

success
data object

The response data.

serviceIds array

The list of service IDs.

serviceId string

The service ID.

svc-crbgq0dlhtgrdb***

Examples

Sample success responses

JSONformat

{
  "requestId": "C67DED2B-F19B-5BEC-88C1-D6EB854CD0D4",
  "code": "Ok",
  "message": "success",
  "data": {
    "serviceIds": [
      "svc-crbgq0dlhtgrdb***"
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change time Summary of changes Operation
2026-01-30 The request parameters of the API has changed View Change Details
2025-12-25 The internal configuration of the API is changed, but the call is not affected View Change Details
2025-06-26 The internal configuration of the API is changed, but the call is not affected View Change Details
2025-02-27 The internal configuration of the API is changed, but the call is not affected View Change Details