Saltar al contenido principal
POST
/
v1
/
agent
/
{agent_id}
/
duplicate
Duplicate agent into another project
import requests

url = "https://api.diga.io/v1/agent/{agent_id}/duplicate"

payload = {
    "target_project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "source_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "modified_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "version_number": 123,
  "version_created_at": "2023-11-07T05:31:56Z",
  "voice": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "provider_voice_id": "<string>",
    "is_favourite": true,
    "preview_urls": {},
    "gender": "<string>"
  },
  "version_name": "<string>",
  "is_draft": false,
  "is_published": false,
  "name": "<string>",
  "description": "<string>",
  "prompt": "<string>",
  "greeting": "<string>",
  "time_before_start": 123,
  "volume": 50,
  "max_reminder_count": 3,
  "reminder_frequency_ms": 7500,
  "reminder_messages": [],
  "knowledge_base_ids": [],
  "knowledge_item_ids": [],
  "conversational_path_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "integrations": [],
  "call_tools": [],
  "dynamic_variables": {},
  "flows": [],
  "source_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "validation_issues": [
    {
      "message_code": "<string>",
      "message": "<string>",
      "params": {}
    }
  ]
}

Autorizaciones

Authorization
string
header
requerido

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Parámetros de ruta

agent_id
string<uuid>
requerido

Cuerpo

application/json
target_project_id
string<uuid>
requerido

Project where the duplicated agent draft will be created

source_version_id
string<uuid> | null

Specific source version to duplicate. Defaults to the current draft.

name
string | null

Optional name for the duplicated agent. Defaults to "{original} (copy)".

Respuesta

Successful Response

agent_id
string<uuid>
requerido

The unique identifier for the agent

modified_at
string<date-time>
requerido

The date and time when the agent was last updated

created_at
string<date-time>
requerido

The date and time when the agent was created

version_id
string<uuid>
requerido

The version id of the agent

version_number
integer
requerido

The version number of the agent

version_created_at
string<date-time>
requerido

The date and time when the version was created

voice
Voice · object
requerido

The voice object used by the agent

language
enum<string>
requerido

The language used by the agent. Use multi for the agent using both english and spanish in the same call (multi will expand to more languages in the future)

Opciones disponibles:
es,
en,
multi,
ar,
be,
bn,
bs,
bg,
ca,
hr,
cs,
da,
nl,
et,
fi,
nl-BE,
fr,
de,
de-CH,
el,
he,
hi,
hu,
id,
it,
ja,
kn,
ko,
lv,
lt,
mk,
ms,
mr,
no,
fa,
pl,
pt,
ro,
ru,
sr,
sk,
sl,
sv,
tl,
ta,
te,
tr,
uk,
ur,
vi
mode
enum<string>
requerido

The mode of the agent. Can be 'free' or 'path'

Opciones disponibles:
free,
path
version_name
string | null

The version name of the agent

is_draft
boolean
predeterminado:false

Indicates if the agent is a draft version

is_published
boolean
predeterminado:false

Indicates if the agent is published

name
string | null

The name of the agent

description
string | null

The description given to the agent

prompt
string | null

The prompt given to the agent

greeting
string | null

The greeting message said by the agent to the caller at the beginning of the call. If set, the agent will always speak first both in inbound and outbound calls

time_before_start
number | null

The time in seconds before the agent starts to speak

volume
integer
predeterminado:50

Controls the output volume of the agent's voice. 50 is the default (no change), 0 is silent, 100 is maximum gain.

Rango requerido: 0 <= x <= 100
max_reminder_count
integer
predeterminado:3

The maximum number of reminders that can be sent to the caller. If not provided, the default value is 3. Set this value to 0 to disable reminders

Rango requerido: x >= 0
reminder_frequency_ms
integer
predeterminado:7500

The frequency in milliseconds to send reminders to the caller. If not provided, the default value is 7500.

reminder_messages
string[]

The list of messages to send to the caller as reminders. If not provided, the default value is an empty list which makes the model to generate the reminder messages by itself. Please, note that when using an empty list, the reminder_frequency_ms can be a little bit higher than specified since it has to generate the messages

knowledge_base_ids
string<uuid>[] | null

The list of knowledge bases available for the agent to use

knowledge_item_ids
string<uuid>[] | null

The list of knowledge items directly available for the agent to use

conversational_path_id
string<uuid> | null

The id of the conversational path used by the agent.

integrations
IntegrationToolsResponse · object[]

The list of integrations and their assigned tools for the agent

call_tools
(TransferCallToolSchema · object | HangUpToolSchema · object | DetectAnsweringMachineToolSchema · object)[]

The list of call-tools (built-in tools) assigned to the agent

Transfer a call to another number.

Wire shape (FLAT, all fields top-level):

{
"type": "transfer_call",
"name": "transfer_to_owner",
"target_number": "+34600112233",
"description": "Transfer when the caller asks to speak with the owner",
"transfer_type": "transfer"
}
dynamic_variables
Dynamic Variables · object | null

Agent-level dynamic variables for template interpolation. Overridden by call-level variables.

background_audio
enum<string> | null

The background audio to be used in the calls that this agent handles

Opciones disponibles:
call_center,
cafe,
road_traffic,
park,
office,
car_garage
flows
FlowInfoResponse · object[]

Detailed flow info assigned to the agent

source_template_id
string<uuid> | null

The ID of the agent template this agent was created from

validation_issues
ValidationIssueSchema · object[] | null

List of issues that would prevent launching/publishing. Only present for draft versions on dashboard endpoints.