All Products
Search
Document Center

API Gateway:CreateService

Last Updated:Feb 05, 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

You can call this operation to 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.
OperationAccess levelResource typeCondition keyAssociated operation
apig:CreateServicenone
*Service
acs:apig:{#regionId}:{#accountId}:service/*
    none
none

Request syntax

POST /v1/services HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request body.

gatewayIdstringNo

The gateway instance ID.

gw-cq7l5s5lhtg***
sourceTypestringNo

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
serviceConfigsarray<object>No

The list of service configurations.

objectNo

A service configuration.

namestringNo

The service name.

user-service
namespacestringNo

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
groupNamestringNo

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

DEFAULT_GROUP
addressesarrayNo

The list of domain names or fixed IP addresses.

stringNo

A domain name or fixed IP address.

dev.com:8080
qualifierstringNo

The function version/alias.

LATEST
aiServiceConfigAiServiceConfigNo

The AI service configurations.

agentServiceConfigAgentServiceConfigNo

Agent service configuration

dnsServersarrayNo

The list of DNS service addresses.

stringNo

A DNS service address.

100.100.2.136:53
sourceIdstringNo

Service source ID

nacos-instance-001
validationOptionsobjectNo

Validation options

skipVerifyAIChatCompletionbooleanNo

Skip AI chat completion verification

expressTypestringNo

Express type

Standard
resourceGroupIdstringNo

The resource group ID.

rg-xxx
clientTokenstringNo

clientToken

xxx

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

requestIdstring

The request ID.

C67DED2B-F19B-5BEC-88C1-D6EB854CD0D4
codestring

The status code.

Ok
messagestring

The returned message.

success
dataobject

The response data.

serviceIdsarray

The list of service IDs.

serviceIdstring

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 timeSummary of changesOperation
2026-01-30The request parameters of the API has changedView Change Details
2025-12-25The internal configuration of the API is changed, but the call is not affectedView Change Details
2025-06-26The internal configuration of the API is changed, but the call is not affectedView Change Details
2025-02-27The internal configuration of the API is changed, but the call is not affectedView Change Details