Creates an AI agent instance. This operation returns the agent channel, username, and token for joining the channel.
Operation description
This API creates an agent instance based on the specified AI agent ID (AIAgentId). You can use the information in the API response to join the corresponding channel and chat with the agent.
Ensure that the specified AI agent ID is valid. Configure the optional parameters as needed.
Try it now
Test
RAM authorization
Action | Access level | Resource type | Condition key | Dependent action |
ice:GenerateAIAgentCall | none | *All Resource
| None | None |
Request parameters
Parameter | Type | Required | Description | Example |
AIAgentId | string | Yes | The agent ID. | 39f8e0bc005e4f309379701645f4**** |
Expire | integer | No | The validity period of the token in seconds. The default value is 3600. The value must be in the range of 0 to 604800. | 3600 |
UserId | string | No | The username in the channel. If you do not specify a username, the system automatically generates one. The username can contain up to 64 characters. | 877ae632caae49b1afc81c2e8194ffb4 |
TemplateConfig | No |
Note This parameter is deprecated. For more information, see the AgentConfig parameter. | ||
UserData | string | No | User-defined information. | {"Email":"johndoe@example.com","Preferences":{"Language":"en"}} |
SessionId | string | No | A unique identifier for the session. | fw1gr0bc005e4f309379701645f4**** |
AgentConfig | No | The agent template configuration. The configuration you provide is merged with the agent template configuration from the console. If you do not set this parameter, the agent's default configuration from the console is used. Note Compatibility with TemplateConfig: Fields in AgentConfig take precedence. If a field is specified in TemplateConfig but not in AgentConfig, the value from TemplateConfig is used. Use AgentConfig instead of TemplateConfig. | ||
| ChatSyncConfig | object | No | The configuration for chat record synchronization. | |
IMAIAgentId | string | No | The ID of the Instant Messaging (IM) agent (chatbot). | ******005e4f309379701645f4**** |
ReceiverId | string | No | The ID of the receiving user. | 4167626d312034b2b1c3b7f2f3e41884 |
Response elements
Element | Type | Description | Example |
object | Schema of Response | ||
AIAgentUserId | string | The name of the agent in the Alibaba Real-time Communication (ARTC) channel. | 877ae632caae49b1afc81c2e8194ffb4 |
ChannelId | string | The ARTC channel ID. | 70f22d5784194938a7e387052f2b3208 |
InstanceId | string | The ID of the generated agent instance. | 39f8e0bc005e4f309379701645f4**** |
RequestId | string | The request ID. | 7B117AF5-2A16-412C-B127-FA6175ED1AD0 |
Token | string | The client-side ARTC token. | eyJhcHBpZCI6ICIxMjM0MTIzNxxxxx |
UserId | string | The username in the ARTC channel. | user123 |
Examples
Success response
JSON format
{
"AIAgentUserId": "877ae632caae49b1afc81c2e8194ffb4",
"ChannelId": "70f22d5784194938a7e387052f2b3208",
"InstanceId": "39f8e0bc005e4f309379701645f4****",
"RequestId": "7B117AF5-2A16-412C-B127-FA6175ED1AD0",
"Token": "eyJhcHBpZCI6ICIxMjM0MTIzNxxxxx",
"UserId": "user123"
}Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.