v2
latestOpenAPI 3.0.02026-08-051996591.2 MBAgent Aliases
Create an alias
Creates an alias. An alias maps a public name to one or more underlying agents under a configurable policy. When you create a session through an alias (via POST /v2/agent_aliases/{alias_key}/sessions), the alias's policy selects the underlying agent that runs the session.
Common patterns:
- Direct alias — a routed policy with one rule and one target. Identical in behavior to invoking the agent directly.
- Canary rollout — a routed policy with one rule and multiple weighted targets (e.g. 90% v1, 10% v2).
- Tenant routing — a routed policy with multiple rules, each matching on session metadata (e.g. session.metadata.tenant).
post/v2/agent_aliases
Headers
Request-Timeoutinteger
The platform makes a best effort to complete the request in the specified seconds, or it times out.
Request-Timeout-Millisinteger
The platform makes a best effort to complete the request in the specified milliseconds, or it times out.
Request body
Example request
{
"key": "support",
"policy": {
"rules": [
{
"match": "(get('$.session.metadata.tenant') == 'us') and (get('$.session.metadata.tier') == 'gold')",
"targets": {
"partition_by": "get('$.session.metadata.user_id', '')"
}
}
]
}
}Response
The newly created alias.
Example response
{
"key": "support",
"name": "Customer Support",
"policy": {
"rules": [
{
"match": "(get('$.session.metadata.tenant') == 'us') and (get('$.session.metadata.tier') == 'gold')",
"targets": {
"partition_by": "get('$.session.metadata.user_id', '')"
}
}
]
}
}