tencent cloud

APIs

CreateShipper

Download
Focus Mode
Font Size
Last updated: 2026-06-10 15:02:52

1. API Description

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

This API is used to create a task to ship to COS. Note: To use this API, you need to check whether you have configured the role and permission for shipping to COS. If not, see Viewing and Configuring Shipping Authorization at https://www.tencentcloud.com/document/product/614/71623.?from_cn_redirect=1

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: CreateShipper.
Version Yes String Common Params. The value used for this API: 2020-10-16.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
TopicId Yes String

Log topic Id belonging to the created shipping rule.

Bucket Yes String

COS bucket, see the supported bucket naming conventions.

Prefix Yes String

New directory prefix delivered by the Shipping Rule.

  • Only supports 0-9A-Za-z-_/
  • Supports up to 256 characters
ShipperName Yes String

Shipping rule name. Supports a maximum of 255 characters.

Interval No Integer

Shipping time interval in seconds. Default: 300. Range: 300-900.

MaxSize No Integer

Maximum value of delivered files in MB. Default: 256. Range: 5-256.

FilterRules.N No Array of FilterRuleInfo

Filter rules for log shipping. Matched logs are shipped. The relationship between the rules is and. Up to 5 rules are allowed. An empty array indicates all logs are shipped without filtering.

Partition No String

Partition rules for log shipping support strftime time format representation

Compress No CompressInfo

Compression configuration of shipped logs

Content No ContentInfo

Content format configuration for shipped logs

FilenameMode No Integer

Delivery file naming configuration. 0: Random number naming, 1: Delivery time naming. Default: 0 (Random number naming).

StartTime No Integer

Starting point of the data shipping range (Unix second-level timestamp). It cannot exceed the starting point of the log topic's lifecycle.
If not filled in by the user, it defaults to the time when the user creates the shipping task.

EndTime No Integer

End time point of the data shipping range (unix second-level timestamp). It cannot be in the future.
If not filled in by the user, it defaults to continuous shipping, unlimited.

StorageType No String

The storage type of an object. Default value is STANDARD. For enumeration values, please refer to the storage type overview document.
Reference values include:

  • STANDARD: standard storage
  • STANDARD_IA: infrequent storage
  • ARCHIVE: archive storage
  • DEEP_ARCHIVE: deep archive storage
  • MAZ_STANDARD: standard storage (multi-AZ)
  • MAZ_STANDARD_IA: infrequent storage (multi-AZ)
  • INTELLIGENT_TIERING: intelligent tiering storage
  • MAZ_INTELLIGENT_TIERING: intelligent tiering storage (multi-AZ)
RoleArn No String

Role ARN Create role

ExternalId No String

External ID

TimeZone No String

Used to generate time variables in the file path shipped to COS.

Input limit: Support the following time zone list.

  • GMT-12:00
  • GMT-11:00
  • GMT-10:00
  • GMT-09:30
  • GMT-09:00
  • GMT-08:00
  • GMT-07:00
  • GMT-06:00
  • GMT-05:00
  • GMT-04:00
  • GMT-03:30
  • GMT-03:00
  • GMT-02:00
  • GMT-01:00
  • GMT+00:00
  • GMT+01:00
  • GMT+02:00
  • GMT+03:30
  • GMT+04:00
  • GMT+04:30
  • GMT+05:00
  • GMT+05:30
  • GMT+05:45
  • GMT+06:00
  • GMT+06:30
  • GMT+07:00
  • GMT+08:00
  • GMT+09:00
  • GMT+09:30
  • GMT+10:00
  • GMT+10:30
  • GMT+11:00
  • GMT+11:30
  • GMT+12:00
  • GMT+12:45
  • GMT+13:00
  • GMT+14:00
  • UTC-11:00
  • UTC-10:00
  • UTC-09:00
  • UTC-08:00
  • UTC-12:00
  • UTC-07:00
  • UTC-06:00
  • UTC-05:00
  • UTC-04:30
  • UTC-04:00
  • UTC-03:30
  • UTC-03:00
  • UTC-02:00
  • UTC-01:00
  • UTC+00:00
  • UTC+01:00
  • UTC+02:00
  • UTC+03:00
  • UTC+03:30
  • UTC+04:00
  • UTC+04:30
  • UTC+05:00
  • UTC+05:45
  • UTC+06:00
  • UTC+06:30
  • UTC+07:00
  • UTC+08:00
  • UTC+09:00
  • UTC+09:30
  • UTC+10:00
  • UTC+11:00
  • UTC+12:00
  • UTC+13:00
DSLFilter No String

Pre-filtering process - perform pre-filtering on the original data written to COS

3. Output Parameters

Parameter Name Type Description
ShipperId String

Delivery task 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 Shipping Rule

Create a cos delivery task rule

Input Example

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

{
    "TopicId": "fadcc986-xxxx-xxxx-b766-9ce9c193da32",
    "Bucket": "examplebucket-1250000000",
    "Prefix": "bow-test-1250000000",
"ShipperName": "bow-delivery task"
    "Interval": 300,
    "MaxSize": 5,
    "FilenameMode": 1,
    "FilterRules": [
        {
            "Key": "http",
            "Regex": "^(\\d+\\.\\d+)\\..*",
            "Value": "172.16"
        }
    ],
    "Partition": "/%Y/%m/%d/%H/",
    "Compress": {
        "Format": "none"
    },
    "RoleArn": "",
    "ExternalId": "",
    "Content": {
        "Format": "json",
        "Json": {
            "EnableTag": true,
            "MetaFields": [
                "__SOURCE__",
                "__FILENAME__",
                "__HOSTNAME__",
                "__TIMESTAMP__"
            ],
            "JsonType": 1
        }
    },
    "StartTime": 1735544418,
    "EndTime": 0
}

Output Example

{
    "Response": {
        "RequestId": "3d8b7942-xxxx-xxxx-8c14-7c665344223c",
        "ShipperId": "a851ee81-xxxx-xxxx-852d-55fa5ac58269"
    }
}

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
AuthFailure CAM signature/authentication error.
FailedOperation Operation failed.
InternalError Internal error.
InvalidParameter Incorrect parameter.
InvalidParameter.ShipperConflict Shipping rule naming conflict.
InvalidParameterValue Incorrect parameter value.
LimitExceeded.Shipper The number of shipping rules exceeds the limit.
MissingParameter Missing parameter.
OperationDenied Operation denied.
OperationDenied.ACLFailed ACL verification failed.
OperationDenied.AccountDestroy The account has been terminated.
OperationDenied.AccountIsolate The account has overdue payments.
OperationDenied.AccountNotExists The account does not exist.
ResourceNotFound.TopicNotExist The log topic does not exist.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback