Create agent from template
Create a new agent in a workspace as a copy of an agent template (list_agent_templates), and return its handle. The copy takes the template's latest version as an unpublished draft version 1: system prompt, greetings, tools, workflow, model, voice and call settings. The template's prompt and greetings read {{variables}} for the business's facts. A variable a workspace Shared setting holds comes from that set, which is attached to the new agent; every other plain variable is created on the copy with no value, and the template's secret variables are not created. `variablesToSet` lists both: set each plain one with set_plain_variable and each secret with set_secret_variable before publishing. Tests, phone numbers and knowledge-base sources are not copied.
Authorization
bearerAuth A personal access token from Settings > API tokens.
In: header
Header Parameters
A key you choose, such as a UUID, that makes this POST safe to retry. Within 24 hours the same key and request answers with the first successful answer and runs nothing, the same key with a different request answers 422 idempotency_key_reused, and a key whose request is still running answers 409 idempotency_key_in_use. A failed request keeps nothing, so the same key runs it again.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/operations/create_agent_from_template" \ -H "Content-Type: application/json" \ -d '{ "workspace": "string", "template": "string" }'{}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}Make a connect link POST
Make a lasting link that connects an app for THIS agent, to text or email to whoever owns the account. initiate_agent_connection's redirectUrl dies about 10 minutes after it's made; this link starts a fresh sign-in each time it's opened, so it keeps working for `days` (default 30). Opening it does what initiate_agent_connection does, acting as the workspace owner, and it stops working once the app is connected on this agent. Returns `{ url, until }`. Anyone holding the link can connect an account to this agent until then, so send it only to the account's owner. Apps that need the operator's own OAuth-app credentials can't be connected from a link; connect those in Connected apps in the app. Requires workspace-admin.
Create alert POST
Create a workspace alert rule that watches a metric and fires when it moves. Pick the shape: alertType='trend' (a statistically significant move vs the rolling baseline, set sensitivityPreset) or alertType='threshold' (the value crosses a fixed bound, set condition + threshold params). The metricKey must be a numeric/continuous/workflow-adherence metric from the catalogue (call list_metrics first). The rule is workspace-scoped and evaluated by the alert cron; delivery defaults to in-app only. Creating an alert requires workspace-admin rights (delivery can reach Slack/email). Use list_alerts first to avoid duplicating an existing rule.