---
title: "Create a dynamic behavior set"
method: POST
path: "/v1/{organization}/dynamic_behavior_set/"
tags: ["Dynamic Behavior Set"]
---

# 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.

## Path parameters

- `organization` string, required

## Headers

- `x-mongo-cluster-name` string, nullable — 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-Protocol` string[]

## Request body

- SrcAppEndpointsDynamicBehaviorSetCreateDynamicBehaviorSetRequest
  - `name` string, required
  - `tags` object, required — The tags of the dynamic behavior set. Both the key and the value can only contain alphanumeric characters, underscores, or spaces.
  - `applied_to_services` string[], required — The services that the dynamic behavior set should be applied to.
  - `initial_version` SrcAppEndpointsDynamicBehaviorSetCreateDynamicBehaviorSetRequestInitialVersion, required
    - `is_active` boolean, required — After adding this initial version, whether the dynamic behavior set should be activated.
    - `conversation_triggers` AmigoLibPydanticBaseModelStrippedNonemptyString1[], required — The conversation triggers for the dynamic behavior set version.
    - `actions` union[], required — The action to perform when the dynamic behavior set version is activated.
      - union
        - InjectInstructionActionInput
          - `type` 'inject-instruction', required
          - `instruction` string, required
          - `overrides_instructions` boolean, required — During injection, whether the original instruction of the state is overriden with this instruction.
        - SrcAppEndpointsDynamicBehaviorSetCreateDynamicBehaviorSetRequestInitialVersionChangeToolCandidatesAction
          - `type` 'change-tool-candidates', required
          - `tool_call_specs` SrcAppEndpointsDynamicBehaviorSetCreateDynamicBehaviorSetRequestInitialVersionChangeToolCandidatesActionToolCallSpec[], required
            - `tool_id` string, required — The ID of the tool.
            - `version_constraint` string, required — A [Python packaging version constraint](https://packaging.python.org/en/latest/specifications/version-specifiers/#id5) of the tool.
            - `additional_instruction` string, required
            - `audio_fillers` AmigoLibPydanticBaseModelStrippedNonemptyString1[], required — A list of audio fillers to play in audio mode if the tool is taking a long time.
            - `audio_filler_triggered_after` number, required — The number of seconds to wait before playing an audio filler.
            - `result_persistence` 'ephemeral' | 'persisted-preferred' | 'persisted', required
            - `tool_name` string, required
          - `overrides_existing_tool_call_specs` boolean, required — During injection, whether the existing tool call specs are overriden with these new specs.

## Response `201`

Succeeded.

- SrcAppEndpointsDynamicBehaviorSetCreateDynamicBehaviorSetResponse
  - `dynamic_behavior_set_id` string, required — The ID of the newly created dynamic behavior set.

## Other responses

- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — The specified organization, service, or tool does not exist.
- `409` — If the initial version is defined and `is_active` is set to `True`, an active dynamic behavior set with the same name already exists.
- `422` — Invalid request path parameter or request body failed validation.
- `429` — The user has exceeded the rate limit of 200 requests per minute for this endpoint.
- `503` — The service is going through temporary maintenance.

---

[API](https://skmtc.net/amigo/apis/amigo-api.md) · [All operations](https://skmtc.net/amigo/apis/amigo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/amigo/amigo-api/revisions/f0f28319e448/schema)
