For the complete documentation index, see llms.txt. This page is also available as Markdown.

Dynamic Behaviors

Create trigger-based behavior sets that inject instructions or modify tool availability during conversations.

Manage organization-scoped, versioned sets of trigger-based behaviors that activate during conversations. This page documents the core API endpoints for creating, updating, and managing Dynamic Behavior Sets and their versions.

API Terminology: In the API, these are called "Dynamic Behavior Sets" (dynamic_behavior_set). In our conceptual documentation and platform UI, we refer to them as "Dynamic Behaviors": configurable rules that inject instructions or modify tool availability based on conversation context. See Conceptual Docs: Dynamic Behaviors for the architectural perspective.

Overview

Dynamic Behavior Sets are versioned collections of trigger-action rules that activate during conversations when specific patterns are detected. Each set contains:

  • Conversation Triggers: natural-language descriptions of conversation patterns that activate the behavior, matched via semantic similarity.

  • Actions: operations performed when a trigger fires. Two action types are supported:

    • inject-instruction: injects additional instructions into the agent's context.

    • change-tool-candidates: modifies the set of tools available to the agent.

Key Properties

  • Organization-scoped: each behavior set belongs to a single organization.

  • Versioned: each set maintains a version history. New versions are created with incremented version numbers.

  • Service-bound: behavior sets are applied to one or more services and activated via version sets.

  • Activatable: sets have an is_active flag that controls whether they are eligible for invocation.

How They Relate to Services

Dynamic Behavior Sets are applied to services through version sets. When a conversation is created with a specific version set, the platform evaluates the associated behavior sets' triggers against each user message. When a trigger matches, the corresponding actions run within that interaction.

For more on configuring version sets, see Version Sets & Promotion. For data access and table schemas, see Dynamic Behaviors Data Access.

Trigger Evaluation Flow

Typical Lifecycle

  1. Create a behavior set with an initial version (name, triggers, actions).

  2. Apply it to one or more services.

  3. Test in a staging version set.

  4. Activate the set (is_active: true) and promote to release.

  5. Create new versions as triggers or actions evolve.

  6. Query invocation history to verify trigger accuracy.

Rate Limits

Endpoint
Limit

Create a set

200 requests per minute

List sets

500 requests per minute

Search sets

50 requests per minute

Update a set

500 requests per minute

Delete a set

500 requests per minute

Get invocations

50 requests per minute

Create a version

200 requests per minute

Get versions

1000 requests per minute

Action Types

Inject Instruction

Adds or overrides the agent's instructions when a trigger fires.

Field
Type
Description

type

string

Must be "inject-instruction"

instruction

string

The instruction text to inject

overrides_instructions

boolean

If true, replaces the state's original instruction. If false, appends to it.

Change Tool Candidates

Modifies the tools available to the agent when a trigger fires.

Field
Type
Description

type

string

Must be "change-tool-candidates"

tool_call_specs

array

List of tool call specifications to add or replace

overrides_existing_tool_call_specs

boolean

If true, replaces existing tool specs. If false, adds to them.

Each entry in tool_call_specs requires all of the following fields:

Field
Type
Description

tool_id

string

The ID of the tool

tool_name

string

An identifier of the tool displayed in the behavior set's description

version_constraint

string

A Python packaging version constraint for the tool

additional_instruction

string

Instruction supplied to the LLM in addition to the tool's description

audio_fillers

array

Audio fillers to play in audio mode if the tool is taking a long time

audio_filler_triggered_after

number

Seconds to wait before playing an audio filler

result_persistence

string

ephemeral, persisted-preferred, or persisted

Create a Dynamic Behavior Set

Create a new dynamic behavior set along with its initial version. The initial version defines the triggers and actions that will be active when the set is activated.

Response (201):

Create a dynamic behavior set

post
/v1/{organization}/dynamic_behavior_set/

Create a new dynamic behavior set as well as its initial version.

Permissions

This endpoint requires the following permissions:

  • DynamicBehaviorInstruction:CreateDynamicBehaviorInstruction on the set to create.
  • DynamicBehaviorInstruction:UpdateDynamicBehaviorInstruction on the set to create.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Header parameters
x-mongo-cluster-namestring · nullableOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
namestring · min: 1Required

The name of the dynamic behavior set.

applied_to_servicesstring[]Required

The services that the dynamic behavior set should be applied to.

Responses
201

Succeeded.

application/json
dynamic_behavior_set_idstringRequired

The ID of the newly created dynamic behavior set.

post/v1/{organization}/dynamic_behavior_set/

List Dynamic Behavior Sets

Retrieve dynamic behavior sets matching the given filters. Only sets the authenticated user has DynamicBehaviorInstruction:GetDynamicBehaviorInstruction permission for are returned.

Common filters:

  • id=<id> (repeatable): filter by specific IDs

  • is_active=true|false: filter by active status

  • applied_to_service=<service_id> (repeatable): filter by associated service

  • creator=<org_id,user_id> (repeatable): filter by creator

  • tag=key:value (repeatable; value may be * for any value, or empty for null)

  • sort_by=+updated_at|-updated_at (repeatable)

  • limit (0-50, default 50), continuation_token (int, default 0)

Get dynamic behavior sets

get
/v1/{organization}/dynamic_behavior_set/

Retrieve dynamic behavior sets that match the given filters.

Permissions

This endpoint may be impacted by the following permissions:

  • Only dynamic behavior sets that the authenticated user has DynamicBehaviorInstruction:GetDynamicBehaviorInstruction permission for will be retrieved.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Query parameters
idstring[]Optional

The IDs of the dynamic behavior sets to retrieve.

Default: []
limitinteger · max: 50Optional

The maximum number of dynamic behavior sets to return.

Default: 50
continuation_tokenintegerOptional

The continuation token to use to retrieve the next set of dynamic behavior sets.

Default: 0
is_activeboolean · nullableOptional

Whether the dynamic behavior set is active.

applied_to_servicestring[]Optional

The IDs of the services that the dynamic behavior set is applied to.

Default: []
creatorstring[]Optional

The creators of the dynamic behavior sets.

Default: []
tagstring[]Optional

The tags of the dynamic behavior sets. Must be specified using the syntax key:value, which means to match all sets with the given key and value pair among its tags. If value is *, it means the value does not matter. If value is empty, it matches against when the value is None.

Default: []
sort_bystring[]Optional

The fields to sort the sets by. Supported fields are updated_at. Specify a + before the field name to indicate ascending sorting and - for descending sorting. Multiple fields can be specified to break ties.

Default: []
Header parameters
x-mongo-cluster-namestring · nullableOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded.

application/json
has_morebooleanRequired

Whether there are more dynamic behavior sets to retrieve.

continuation_tokeninteger · nullableRequired

The continuation token to use to retrieve the next set of dynamic behavior sets.

get/v1/{organization}/dynamic_behavior_set/

Search Dynamic Behavior Sets

Search for dynamic behavior sets by text query. The query matches against set names and the triggers of the latest version. Returns the top 50 results sorted by relevance.

get
/v1/{organization}/dynamic_behavior_set/search

Search for dynamic behavior sets that match the given filters and contain the given query in its name and the triggers of its latest version. Only the top 50 results will be returned. The results will be sorted by the relevance of the search query.

Permissions

This endpoint may be impacted by the following permissions:

  • Only dynamic behavior sets that the authenticated user has DynamicBehaviorInstruction:GetDynamicBehaviorInstruction permission for will be retrieved.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Query parameters
querystring · min: 1Required

The query to search for. Any sets containing the terms in its name and the triggers of its latest version would be returned.

is_activeboolean · nullableOptional

Whether the dynamic behavior set is active.

applied_to_servicestring[]Optional

The IDs of the services that the dynamic behavior set is applied to.

Default: []
creatorstring[]Optional

The creators of the dynamic behavior sets. Each value must be of the format org_id,user_id.

Default: []
tagstring[]Optional

The tags of the dynamic behavior sets. Must be specified using the syntax key:value, which means to match all sets with the given key and value pair among its tags. If value is *, it means the value does not matter. If value is empty, it matches against when the value is None.

Default: []
Header parameters
x-mongo-cluster-namestring · nullableOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded.

application/json
get/v1/{organization}/dynamic_behavior_set/search

Update a Dynamic Behavior Set

Update a dynamic behavior set's metadata, service associations, or active status. All fields are optional; only provided fields are updated.

Update a dynamic behavior set

post
/v1/{organization}/dynamic_behavior_set/{dynamic_behavior_set_id}/

Update a dynamic behavior set.

Permissions

This endpoint requires the following permissions:

  • DynamicBehaviorInstruction:UpdateDynamicBehaviorInstruction on the dynamic behavior set to update.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
dynamic_behavior_set_idstringRequired

The ID of the dynamic behavior set to delete.

Pattern: ^[a-f0-9]{24}$
Header parameters
x-mongo-cluster-namestring · nullableOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
namestring · min: 1 · nullableOptional

The name of the dynamic behavior set.

applied_to_servicesstring[] · nullableOptional

The services that the dynamic behavior set should be applied to.

is_activeboolean · nullableOptional

Whether the dynamic behavior set is active.

Responses
204

Succeeded.

No content

post/v1/{organization}/dynamic_behavior_set/{dynamic_behavior_set_id}/

No content

Delete a Dynamic Behavior Set

Permanently delete a dynamic behavior set.

Delete a dynamic behavior instruction

delete
/v1/{organization}/dynamic_behavior_set/{dynamic_behavior_set_id}/

Delete a dynamic behavior set.

Permissions

This endpoint requires the following permissions:

  • DynamicBehaviorInstruction:DeleteDynamicBehaviorInstruction on the dynamic behavior set to delete.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
dynamic_behavior_set_idstringRequired

The ID of the dynamic behavior set to delete.

Pattern: ^[a-f0-9]{24}$
Header parameters
x-mongo-cluster-namestring · nullableOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded.

application/json
anyOptional
delete/v1/{organization}/dynamic_behavior_set/{dynamic_behavior_set_id}/

No content

Get Invocations

Retrieve the invocation history for a dynamic behavior set: a record of when and where the behavior's triggers fired during conversations. This is useful for verifying trigger accuracy and auditing activation frequency.

Common filters:

  • limit (1-30, default 30)

  • continuation_token (int, default 0)

  • sort_by=+invoked_at|-invoked_at (repeatable)

Only invocations from messages that the authenticated user has the Conversation:GetMessage permission for are returned.

Get dynamic behavior invocations

get
/v1/{organization}/dynamic_behavior_set/{dynamic_behavior_set_id}/invocation/

Retrieve the dynamic behavior invocations for a dynamic behavior set.

Permissions

This endpoint requires the following permissions:

  • DynamicBehaviorInstruction:GetDynamicBehaviorInstruction for the dynamic behavior set.

This endpoint is impacted by the following permissions:

  • Only invocations from messages that the authenticated user has the Conversation:GetMessage permission for are returned.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
dynamic_behavior_set_idstringRequired

The ID of the dynamic behavior set.

Pattern: ^[a-f0-9]{24}$
Query parameters
limitinteger · max: 30Optional

The maximum number of dynamic behavior invocations to return.

Default: 30
continuation_tokenintegerOptional

The continuation token from the previous request used to retrieve the next page of dynamic behavior invocations.

Default: 0
sort_bystring[]Optional

The fields to sort the versions by. Supported fields are invoked_at. Specify a + before the field name to indicate ascending sorting and - for descending sorting. Multiple fields can be specified to break ties.

Default: []
Header parameters
x-mongo-cluster-namestring · nullableOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded.

application/json
has_morebooleanRequired

Whether there are more dynamic behavior invocations to retrieve.

continuation_tokeninteger · nullableRequired

A token to supply to the next request to retrieve the next page of dynamic behavior invocations. Only populated if has_more is True.

get/v1/{organization}/dynamic_behavior_set/{dynamic_behavior_set_id}/invocation/

Create a Version

Create a new version of an existing dynamic behavior set. Each version defines a complete set of triggers and actions. Version numbers are automatically incremented.

Response (201):

You can optionally pass ?version=<n> as a query parameter to assert the expected version number. If the next version does not match, the request returns HTTP 400.

Create a new version of a dynamic behavior set.

post
/v1/{organization}/dynamic_behavior_set/{dynamic_behavior_set_id}/version/

Create a new version of the given dynamic behavior set.

Permissions

This endpoint requires the following permissions:

  • DynamicBehaviorInstruction:UpdateDynamicBehaviorInstruction on the dynamic behavior set to create a new version for.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
dynamic_behavior_set_idstringRequired

The ID of the dynamic behavior set to delete.

Pattern: ^[a-f0-9]{24}$
Query parameters
versioninteger · nullableOptional

The version number of the new version. If specified, this endpoint throws an error if the next version in the database doesn't equal to the value of this parameter.

Header parameters
x-mongo-cluster-namestring · nullableOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
conversation_triggersstring[] · min: 1 · max: 50Required

The conversation triggers for the dynamic behavior set version.

Responses
201

Succeeded.

application/json
new_version_numberintegerRequired

The version number of the new version.

post/v1/{organization}/dynamic_behavior_set/{dynamic_behavior_set_id}/version/

Get Versions

Retrieve the version history for a dynamic behavior set.

Common filters:

  • version=<constraint>: exact version number, "latest" for the most recent, or an inclusive range of version numbers separated by - (for example 2-5)

  • limit (1-10, default 10)

  • continuation_token (int, default 0)

  • sort_by=+version|-version (repeatable)

Get dynamic behavior set versions

get
/v1/{organization}/dynamic_behavior_set/{dynamic_behavior_set_id}/version/

Get the versions of a dynamic behavior set.

Permissions

This endpoint requires the following permissions:

  • DynamicBehaviorInstruction:GetDynamicBehaviorInstruction for the dynamic behavior set to retrieve.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
dynamic_behavior_set_idstringRequired

The ID of the dynamic behavior set.

Pattern: ^[a-f0-9]{24}$
Query parameters
versionstring · nullableOptional

The versions of the dynamic behavior set to retrieve. One can specify an exact version to retrieve, which is either the version number or latest, which retrieves the latest version. Alternatively, one can specify a range of inclusive lower and upper bound for the version number separated by -, and every version within the range would be retrieved.

Example: 1
limitinteger · max: 10Optional

The maximum number of dynamic behavior set versions to return.

Default: 10
continuation_tokenintegerOptional

The continuation token from the previous request used to retrieve the next page of dynamic behavior set versions.

Default: 0
sort_bystring[]Optional

The fields to sort the versions by. Supported fields are version. Specify a + before the field name to indicate ascending sorting and - for descending sorting. Multiple fields can be specified to break ties.

Default: []
Header parameters
x-mongo-cluster-namestring · nullableOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded.

application/json
has_morebooleanRequired

Whether there are more dynamic behavior set versions to retrieve.

continuation_tokeninteger · nullableRequired

A token to supply to the next request to retrieve the next page of dynamic behavior set versions. Only populated if has_more is True.

get/v1/{organization}/dynamic_behavior_set/{dynamic_behavior_set_id}/version/

Last updated

Was this helpful?