All Products
Search
Document Center

Serverless App Engine:CreateNamespace

Last Updated:Jan 12, 2026

Creates a namespace.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

sae:CreateNamespace

create

*All Resource

*

None None

Request syntax

POST /pop/v1/paas/namespace HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

NamespaceId

string

No

The long-format namespace ID. If you specify this parameter, `NameSpaceShortId` is ignored. This parameter is retained for compatibility. Use the short-format namespace ID instead. The format is `<RegionId>:<NamespaceId>. The `NamespaceId can contain only lowercase letters and digits and cannot exceed 32 characters in length. Example: `cn-beijing:test. For information about the regions that SAE supports, see DescribeRegions.

cn-beijing:test

NamespaceName

string

Yes

The name of the namespace. The name cannot exceed 64 characters in length.

name

NamespaceDescription

string

No

The description of the namespace. The description cannot exceed 100 characters in length.

desc

NameSpaceShortId

string

No

The short-format namespace ID. You do not need to specify a region ID. This parameter is recommended. The ID cannot exceed 20 characters in length and can contain only lowercase letters and digits.

test

EnableMicroRegistration

boolean

No

Specifies whether to enable the built-in service registry of SAE.

  • true

  • false

The default value is true. If you do not use the built-in service registry, set this parameter to false to speed up namespace creation.

true

Response elements

Element

Type

Description

Example

object

The returned data.

RequestId

string

The request ID.

91F93257-7A4A-4BD3-9A7E-2F6EAE6D****

Message

string

The additional information returned.

success

TraceId

string

The trace ID. You can use the trace ID to query the details of a request.

0a981dd515966966104121683d****

Data

object

The information about the namespace.

NamespaceDescription

string

The description of the namespace.

desc

NamespaceId

string

The ID of the namespace.

cn-beijing:test

NamespaceName

string

The name of the namespace.

name

RegionId

string

The region where the namespace resides.

cn-beijing

NameSpaceShortId

string

The short-format namespace ID.

test

EnableMicroRegistration

boolean

Indicates whether the built-in service registry of SAE is enabled.

  • true

  • false

true

ErrorCode

string

The error code.

  • If the request is successful, this parameter is not returned.

  • If the request fails, this parameter is returned. For more information, see the Error codes section in this topic.

Code

string

The HTTP status code or a POP error code. Valid values:

  • 2xx: The request was successful.

  • 3xx: The request was redirected.

  • 4xx: A request error occurred.

  • 5xx: A server error occurred.

200

Success

boolean

Indicates whether the namespace was successfully created. Valid values:

  • true: The namespace was created.

  • false: The namespace failed to be created.

true

Examples

Success response

JSON format

{
  "RequestId": "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
  "Message": "success",
  "TraceId": "0a981dd515966966104121683d****",
  "Data": {
    "NamespaceDescription": "desc",
    "NamespaceId": "cn-beijing:test",
    "NamespaceName": "name",
    "RegionId": "cn-beijing",
    "NameSpaceShortId": "test",
    "EnableMicroRegistration": true
  },
  "ErrorCode": "空",
  "Code": "200",
  "Success": true
}

Error codes

HTTP status code

Error code

Error message

Description

400 InstanceExist.NamespaceId The specified namespace ID already exists. The specified namespace ID already exists.
400 InvalidNamespace.WithUppercase This namespace does not support creating SAE apps because it contains uppercase letters.
400 InvalidNamespaceId.Format The specified NamespaceId is invalid. The specified NamespaceId is invalid. The correct format is [regionId]:[namespace]. For example, cn-beijing:test. NamespaceId cannot exceed 32 characters in length.
400 InvalidNamespaceIdSuffix.Format The specified NamespaceId is invalid. NamespaceId can only contain alphabetical letters or numbers. The specified NamespaceId is invalid. NamespaceId can only contain alphabetical letters or numbers.
400 InvalidNamespaceName.Format The specified NamespaceName is invalid. The name of the namespace cannot exceed 63 characters in length. The specified NamespaceName is invalid. The name of the namespace cannot exceed 63 characters in length.
400 InvalidOperation.NamespaceClusterNotDeleted The specified NamespaceId contains clusters. The specified NamespaceId contains clusters.
400 Namespace.AppExists Please delete the application first.
400 System.Upgrading The system is being upgraded. Please try again later.
400 Exceed.Namespace Too many namespaces have been created.
500 OperationFailed.DauthHttpRequest request dauth failed.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.