Add Collection

Last edited on 2026-03-16

This API should be called on the server side and cannot be called directly on the client side (Mini Program, web page, APP, etc.). For details, please refer to API Call Guide.

API English Name: addDatabaseCollection

You can use this interface to add a collection. If you encounter any issues during use, feel free to post and discuss in the Open Platform Service Provider Zone.

1. Call Method

HTTPS Call

POST https://api.weixin.qq.com/tcb/databasecollectionadd?access_token=ACCESS_TOKEN

Cloud Call

  • This API does not support cloud call.

Third-party Call

  • This API supports third-party platforms on behalf of Merchant call.

  • The permission set ID of this API is: 49

  • After the service provider obtains one of the permission set authorizations, it can use authorizer_access_token to call on behalf of Merchant, for details please refer to Third-party Call documentation.

2. Request Parameters

Query Parameters Query String Parameters

ParameterTypeRequiredDescription
access_tokenstringYesAPI call credential, you can use authorizer_access_token

Request Body Request Payload

ParameterTypeRequiredDescription
envstringYesCloud environment ID
collection_namestringYesCollection name

3. Response Parameters

Response Body Response Payload

ParameterTypeDescription
errcodenumberError code
errmsgstringError message

4. Notes

No special notes for this API

5. Code Example

Request Example

{
  "env": "test2-4a89da",
  "collection_name": "test_add_collection"
}

Response Example

{
    "errcode": 0,
    "errmsg": "ok",
}

6. Error Codes

The following is the error code list of this API, other error codes can refer to Common Error Codes; When encountering errors in calling the API, you can use the official API Diagnostic Tool to assist in locating and analyzing problems.

Error CodeError DescriptionSolution
-501000Unknown errorPlease submit a ticket to contact us.
-1000system errorSystem error
-1system errorSystem is busy. Please try again later.
0okok
40001invalid credential  access_token isinvalid or not latestThe AppSecret is incorrect when obtaining the access_token, or the access_token is invalid. Please carefully verify the correctness of the AppSecret, or check if the API is being called for the correct Official Account.
40014invalid access_tokenInvalid access_token. Please carefully check the validity of the access_token (e.g., whether it has expired), or check if the API is being called for the correct Official Account.
40097invalid argsParameter error
40101missing parameterMissing required parameter
41001access_token missingMissing access_token parameter
42001access_token expiredaccess_token has expired. Please check the validity period of the access_token. For detailed mechanism information regarding the access_token, refer to "Basic Support - Obtaining access_token".
43002require POST methodPOST request required
44002empty post dataPOST data packet is empty
47001data format errorFailed to parse JSON/XML content; missing parameters in the post data. Please check, correct, and retry.
85088no qbase privilegeThis App has not enabled Cloud Development.

7. Applicable Scope

This API supports 「Third-party Platform」 account type for proxy calls. For permission sets, please refer to the "Call Method" section. Other account types cannot call unless otherwise specified.