tencent cloud

Creating a Tenant Space
Last updated: 2026-01-07 14:45:20
Creating a Tenant Space
Last updated: 2026-01-07 14:45:20

Description

Use to create tenant space.
Note:
Requires admin or create_space permissions. For details on permissions, see Generate Access Token for Interface.
This interface is only available in media libraries with multi-tenant mode enabled.
Media Hosting currently does not provide the name attribute of the Tenant Space. If your business requires this, you can maintain the mapping between Space IDs and space names on your own.
Extended attributes can be specified in JSON format in the request body when a Tenant Space is created.

Request

Request Example

POST /api/v1/space/`{LibraryId}`?access_token=`{AccessToken}`&user_id=`{UserId}`

Request Parameter

Request parameters.
Description
Type
Required or Not
LibraryId
Media Library ID, obtained after creating a media library in the media hosting console. Please refer to Create Media Library
String
Yes
AccessToken
Access token, please see Generate Access Token
String
Yes
UserId
User identity recognition. When the access token corresponds to admin permission and user identity recognition is empty when applying for the access token, it is used to temporarily specify user identity. For details, see Generate Access Token
String
No

Request Body

Empty or application/json, extended attributes of the designated tenant space can be specified.
{
"isPublicRead": false,
"isMultiAlbum": true,
"allowPhoto": true,
"allowVideo": true,
"allowPhotoExtname": [ ".jpg", ".png", ".heic" ],
"allowVideoExtname": [ ".mp4", ".mov" ],
"recognizeSensitiveContent": true,
"spaceTag": "team"
}
Request body fields:
Request parameters.
Description
Type
Required or Not
isPublicRead
Whether with public read permission, defaults to false. When the tenant space is set with public read permission, some Read APIs do not need to specify an access token. See the specific API description. This parameter allows for modification.
Boolean
No
isMultiAlbum
Whether with multiple albums, defaults to false. At this point, the tenant space does not allow creating directories or albums. This parameter can only be specified when creating the tenant space and cannot be modified subsequently.
Boolean
No
allowPhoto
Whether to allow uploading images, defaults to false. This parameter allows for modification.
Boolean
No
allowVideo
Whether to allow uploading videos, defaults to false. This parameter allows for modification.
Boolean
No
allowPhotoExtname
Defaults to an empty array. If not empty, only uploaded files with extensions in the list are allowed and recognized as photos. If empty, the photo type is dynamically determined based on the file extension. This parameter allows for modification.
Array
No
allowVideoExtname
Defaults to an empty array. If not empty, only uploaded files with extensions in the list are allowed and recognized as videos. If empty, the video type is dynamically determined based on the file extension. This parameter allows for modification.
Array
No
recognizeSensitiveContent
Whether to detect sensitive content. Defaults to false.
Boolean
No
spaceTag
Space flag to identify personal space and team space
String
No

Response

Response code

Successfully obtained, returns HTTP 201 Created.

Response Body

{ "spaceId": "spacexxx" }
Response body field description:
Node Name (Keyword)
Description
Type
spaceId
Space ID of the newly created tenant space
String

Error Codes

This request operation has no special error messages. For common error messages, see Error Codes.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback