tencent cloud

CreateInvoker
Last updated:2026-03-05 16:27:09
CreateInvoker
Last updated: 2026-03-05 16:27:09

1. API Description

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

This API is used to create an invoker.

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: CreateInvoker.
Version Yes String Common Params. The value used for this API: 2020-10-28.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Name Yes String Executor name. length not exceeding 120 characters.
Type Yes String Executor type.

Selectable values (currently only support one):.

-SCHEDULE: period type executor.
CommandId Yes String Remote command ID.

Call the DescribeCommands api to query command details.
InstanceIds.N Yes Array of String Trigger associated instance ID. list cap 100.

You can get the instance ID through the query instance interface of corresponding cloud services. currently supports instance types: CVM, Lighthouse, and TAT managed instances.

The instance needs to have the TAT client installed, and the client must be in Online status. you can query client status via the DescribeAutomationAgentStatus api.
Username No String Command execution user. length not exceeding 256 characters.
Parameters No String Command custom parameter. field type is JSON encode string.

This parameter can be set only when EnableParameter of the command specified by CommandId is true. obtain the EnableParameter settings through the DescribeCommands (query command details) api.
ScheduleSettings No ScheduleSettings Recurring invoker settings.

When the executor type is SCHEDULE, specify this parameter.
Tags.N No Array of Tag Tag associated with the command. list length not exceeding 10.

3. Output Parameters

Parameter Name Type Description
InvokerId String Invoker 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 run-once invoker

Execute command cmd-m7uma92n on instance ins-yx05ky8j at 2021-09-01 00:00:00 UTC+8

Input Example

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

{
    "Name": "test-invoker",
    "CommandId": "cmd-m7uma92n",
    "InstanceIds": [
        "ins-yx05ky8j"
    ],
    "Type": "SCHEDULE",
    "ScheduleSettings": {
        "Policy": "ONCE",
        "InvokeTime": "2021-09-01T00:00:00+08:00"
    }
}

Output Example

{
    "Response": {
        "RequestId": "97268137-e0f7-477d-833b-766273d0ea47",
        "InvokerId": "ivk-le1g3x2h"
    }
}

Example2 Creating an invoker that executes a command repeatedly

Execute command cmd-m7uma92n on instance ins-yx05ky8j at 00:00:00 UTC+8 on the first day of every month

Input Example

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

{
    "Name": "cron-invoker",
    "CommandId": "cmd-m7uma92n",
    "InstanceIds": [
        "ins-yx05ky8j"
    ],
    "Type": "SCHEDULE",
    "ScheduleSettings": {
        "Policy": "RECURRENCE",
        "Recurrence": "0 0 1 * *"
    }
}

Output Example

{
    "Response": {
        "RequestId": "d1d7ce29-b6ac-436d-93e0-b454f096cc50",
        "InvokerId": "ivk-n0t6rxtv"
    }
}

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.
AuthFailure.UnauthorizedOperation Authentication error.
InternalError Internal error.
InvalidParameter Invalid parameter.
InvalidParameterValue.ID Invalid ID format.
InvalidParameterValue.InconsistentID Invalid ID format or inconsistent format in the array.
InvalidParameterValue.InconsistentInstance Inconsistent instance type.
InvalidParameterValue.InvalidCommandId Invalid CommandId.
InvalidParameterValue.InvalidCronExpression Invalid crontab expression.
InvalidParameterValue.InvalidInstanceId Invalid instance ID.
InvalidParameterValue.InvalidTimeFormat Invalid time format.
InvalidParameterValue.InvokeTimeExpired API invocation expired.
InvalidParameterValue.ParameterInvalidJsonFormat The parameter is not a valid JSON string.
InvalidParameterValue.Range The parameter value is not in the valid range.
InvalidParameterValue.TooLong Length limit exceeded.
ResourceNotFound.CommandNotFound The command does not exist.
ResourceNotFound.InstanceNotFound The instance does not exist.
ResourceUnavailable.AgentNotInstalled TAT Agent is not installed.
ResourceUnavailable.AgentStatusNotOnline TAT Agent is offline.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback