tencent cloud

CreateLibrary
Last updated: 2025-12-07 00:27:04
CreateLibrary
Last updated: 2025-12-07 00:27:04

1. API Description

Domain name for API request: smh.intl.tencentcloudapi.com.

This API is used to create a PaaS service media library.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateLibrary.
Version Yes String Common Params. The value used for this API: 2021-07-12.
Region No String Common Params. This parameter is not required for this API.
Name Yes String Media library name. up to 50 characters.
Remark No String Specifies the remark, up to 250 characters.
BucketName No String Specifies the full name of the bucket, which cannot be changed after creation. the current version no longer supports specified buckets.
BucketRegion No String Bucket location cannot be changed after creation. the current version no longer supports specifying bucket location.
LibraryExtension No LibraryExtension Media library configuration item. some parameters cannot be changed after creation.

3. Output Parameters

Parameter Name Type Description
LibraryId String Media library ID.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Creating a Media Library

This example shows you how to create a media library.

Input Example

POST / HTTP/1.1
Host: smh.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateLibrary
<Common request parameters>

{
    "Name": "Name",
    "Remark": "Note",
    "LibraryExtension": {
        "IsFileLibrary": "true"
    }
}

Output Example

{
    "Response": {
        "LibraryId": "smh0q8nrvsg7t6y6",
        "RequestId": "1586674e-e04c-4315-943a-c282b5f8ed6b"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError Internal error.
InternalError.PostpaidFail Post-Payment activation failed.
InvalidParameterValue Parameter value error.
InvalidParameterValue.BucketNameInvalid The bucket name is invalid.
InvalidParameterValue.BucketNameNotBelongYou The bucket name does not belong to the current root account.
InvalidParameterValue.BucketNotFound The bucket does not exist or is not in the specified region.
InvalidParameterValue.BucketNotSupport The service no longer supports selected buckets.
InvalidParameterValue.BucketRegionInvalid Bucket location is invalid.
InvalidParameterValue.CosStorageClass The specified storage class is invalid.
InvalidParameterValue.CosStorageClassIntelligentTiering The specified bucket does not have intelligent tiering storage enabled. activate the intelligent tiering storage feature for the bucket first.
UnauthorizedOperation.PassRole cam:PassRole permission is not granted.
UnauthorizedOperation.ServiceLinkedRole SMH service-related role is not granted.
UnsupportedOperation.BalanceLess Insufficient account balance.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback