menu logo

API/Voicebot/Workflow

Manage voicebot workflows through the API.

  1. Create new workflows with customizable messages and parameters
  2. List and retrieve existing workflows
  3. Update workflow details as needed
  4. Delete workflows
  5. List workflow requests and call statistics
  6. Get workflow request call details

Authentication

All API requests require an API key to be included in the headers:

Authorization: Bearer [access-key]

Create Workflow

POST https://voicebot.intron.health/voicebot/v1/workflows

Create a new workflow with customizable parameters.

Request Body JSON

Field Type Description Required Options Default
name String Name of the workflow yes
description String Description of the workflow no
workflow_type String Type of workflow yes ROBOCALL | CONVERSATION ROBOCALL
message String Message template with variables yes
include_reply Boolean Include reply option in the workflow no true | false false
option_one String Reply text for the first option (if include_reply is true) no
option_two String Reply text for the second option (if include_reply is true) no
call_back_url String URL to receive request status details on completion no

Example Request and Response (without reply)

                    
                        curl --location 'https://voicebot.intron.health/voicebot/v1/workflows' \
                        --header 'Content-Type: application/json' \
                        --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
                        --data '{
                            "name": "Integrator Workflow",
                            "description": "Workflow description V2",
                            "workflow_type": "ROBOCALL",
                            "message": "Hello [name], your appointment is scheduled for [date] at [time]",
                            "include_reply": false,
                            "call_back_url": "https://integrator_call_back_url/:callback"
                        }'
                    
                
                    
                        import requests

                        url = "https://voicebot.intron.health/voicebot/v1/workflows"

                        payload = {
                            "name": "Integrator Workflow",
                            "description": "Workflow description V2",
                            "workflow_type": "ROBOCALL",
                            "message": "Hello [name], your appointment is scheduled for [date] at [time]",
                            "include_reply": false,
                            "call_back_url": "https://integrator_call_back_url/:callback"
                        }
                        headers = {
                            "Authorization": "Bearer YOUR_ACCESS_TOKEN"
                        }

                        response = requests.request("POST", url, headers=headers, json=payload)

                        print(response.json)
                    
                
                    
                        const requestOptions = {
                            method: "POST",
                            headers: {
                                'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
                            },
                            body: JSON.stringify({
                                "name": "Integrator Workflow",
                                "description": "Workflow description V2",
                                "workflow_type": "ROBOCALL",
                                "message": "Hello [name], your appointment is scheduled for [date] at [time]",
                                "include_reply": false,
                                "call_back_url": "https://integrator_call_back_url/:callback"
                            })
                        };
                            
                        fetch("https://voicebot.intron.health/voicebot/v1/workflows", requestOptions)
                        .then((response) => response.text())
                        .then((result) => console.log(result))
                        .catch((error) => console.error(error));
                    
                
                    
                        {
                            "status": "Ok",
                            "message": "workflow created successfully",
                            "data": {
                                "id": "123e4567-e89b-12d3-a456-426614174000",
                                "name": "Integrator Workflow",
                                "description": "Workflow description V2",
                                "workflow_type": "ROBOCALL",
                                "message": "Hello [name], your appointment is scheduled for [date] at [time]",
                                "include_reply": false,
                                "option_one": null,
                                "option_two": null,
                                "call_back_url": "https://integrator_call_back_url/:callback"
                            }
                        }
                    
                

Example Request and Response (with reply)

                    
                        curl --location 'https://voicebot.intron.health/voicebot/v1/workflows' \
                        --header 'Content-Type: application/json' \
                        --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
                        --data '{
                            "name": "Integrator Workflow with Reply",
                            "description": "Workflow with reply options",
                            "workflow_type": "ROBOCALL",
                            "message": "Hello [name], your appointment is scheduled for [date] at [time]. Reply 1 to confirm, 2 to cancel.",
                            "include_reply": true,
                            "option_one": "Reply 1",
                            "option_two": "Reply 2",
                            "call_back_url": "https://integrator_call_back_url/:callback"
                        }'
                    
                
                    
                        import requests

                        url = "https://voicebot.intron.health/voicebot/v1/workflows"

                        payload = {
                            "name": "Integrator Workflow with Reply",
                            "description": "Workflow with reply options",
                            "workflow_type": "ROBOCALL",
                            "message": "Hello [name], your appointment is scheduled for [date] at [time]. Reply 1 to confirm, 2 to cancel.",
                            "include_reply": true,
                            "option_one": "Reply 1",
                            "option_two": "Reply 2",
                            "call_back_url": "https://integrator_call_back_url/:callback"
                        }
                        headers = {
                            "Authorization": "Bearer YOUR_ACCESS_TOKEN"
                        }

                        response = requests.request("POST", url, headers=headers, json=payload)

                        print(response.json)
                    
                
                    
                        const requestOptions = {
                            method: "POST",
                            headers: {
                                'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
                            },
                            body: JSON.stringify({
                                "name": "Integrator Workflow with Reply",
                                "description": "Workflow with reply options",
                                "workflow_type": "ROBOCALL",
                                "message": "Hello [name], your appointment is scheduled for [date] at [time]. Reply 1 to confirm, 2 to cancel.",
                                "include_reply": true,
                                "option_one": "Reply 1",
                                "option_two": "Reply 2",
                                "call_back_url": "https://integrator_call_back_url/:callback"
                            })
                        };
                            
                        fetch("https://voicebot.intron.health/voicebot/v1/workflows", requestOptions)
                        .then((response) => response.text())
                        .then((result) => console.log(result))
                        .catch((error) => console.error(error));
                    
                
                    
                        {
                            "status": "Ok",
                            "message": "workflow created successfully",
                            "data": {
                                "id": "123e4567-e89b-12d3-a456-426614174000",
                                "name": "Integrator Workflow with Reply",
                                "description": "Workflow with reply options",
                                "workflow_type": "ROBOCALL",
                                "message": "Hello [name], your appointment is scheduled for [date] at [time]. Reply 1 to confirm, 2 to cancel.",
                                "include_reply": true,
                                "option_one": "Reply 1",
                                "option_two": "Reply 2",
                                "call_back_url": "https://integrator_call_back_url/:callback"
                            }
                        }
                    
                

List Workflows

GET https://voicebot.intron.health/voicebot/v1/workflows

Retrieve a list of all workflows.

Example Request and Response

                    
                        curl --location 'https://voicebot.intron.health/voicebot/v1/workflows' \
                        --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
                    
                
                    
                        import requests

                        url = "https://voicebot.intron.health/voicebot/v1/workflows"
                        headers = {
                            "Authorization": "Bearer YOUR_ACCESS_TOKEN"
                        }

                        response = requests.request("GET", url, headers=headers)

                        print(response.json)
                    
                
                    
                        const requestOptions = {
                            method: "GET",
                            headers: {
                                'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
                            }
                        };
                            
                        fetch("https://voicebot.intron.health/voicebot/v1/workflows", requestOptions)
                        .then((response) => response.text())
                        .then((result) => console.log(result))
                        .catch((error) => console.error(error));
                    
                
                    
                        {
                            "status": "Ok",
                            "message": "workflows retrieved successfully",
                            "data": [
                                {
                                    "id": "123e4567-e89b-12d3-a456-426614174000",
                                    "name": "Integrator Workflow",
                                    "description": "Workflow description V2",
                                    "workflow_type": "ROBOCALL",
                                    "message": "Hello [name], your appointment is scheduled for [date] at [time]",
                                    "include_reply": true,
                                    "option_one": "Reply 1",
                                    "option_two": "Reply 2",
                                    "call_back_url": "https://integrator_call_back_url/:callback"
                                }
                            ]
                        }
                    
                

Get Workflow Details

GET https://voicebot.intron.health/voicebot/v1/workflows/
:workflow_id

Retrieve details of a specific workflow.

Path Variables

Field Type Description Required Default Options
workflow_id String The unique identifier of the workflow yes

Example Request and Response

                    
                        curl --location 'https://voicebot.intron.health/voicebot/v1/workflows/123e4567-e89b-12d3-a456-426614174000' \
                        --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
                    
                
                    
                        import requests

                        url = "https://voicebot.intron.health/voicebot/v1/workflows/123e4567-e89b-12d3-a456-426614174000"
                        headers = {
                            "Authorization": "Bearer YOUR_ACCESS_TOKEN"
                        }

                        response = requests.request("GET", url, headers=headers)

                        print(response.json)
                    
                
                    
                        const requestOptions = {
                            method: "GET",
                            headers: {
                                'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
                            }
                        };
                            
                        fetch("https://voicebot.intron.health/voicebot/v1/workflows/123e4567-e89b-12d3-a456-426614174000", requestOptions)
                        .then((response) => response.text())
                        .then((result) => console.log(result))
                        .catch((error) => console.error(error));
                    
                
                    
                        {
                            "status": "Ok",
                            "message": "workflow retrieved successfully",
                            "data": {
                                "id": "123e4567-e89b-12d3-a456-426614174000",
                                "name": "Integrator Workflow",
                                "description": "Workflow description V2",
                                "workflow_type": "ROBOCALL",
                                "message": "Hello [name], your appointment is scheduled for [date] at [time]",
                                "include_reply": true,
                                "option_one": "Reply 1",
                                "option_two": "Reply 2",
                                "call_back_url": "https://integrator_call_back_url/:callback"
                            }
                        }
                    
                

Update Workflow

PUT https://voicebot.intron.health/voicebot/v1/workflows/
:workflow_id

Update an existing workflow's details.

Path Variables

Field Type Description Required Default Options
workflow_id String The unique identifier of the workflow to update yes

Request Body JSON

Field Type Description Required Options Default
name String Name of the workflow no
description String Description of the workflow no
workflow_type String Type of workflow no ROBOCALL | CONVERSATION ROBOCALL
message String Message template with variables no
call_back_url String URL to receive request status details on completion no
include_reply Boolean Include reply option in the workflow no true | false false

Example Request and Response

                    
                        curl --location --request PUT 'https://voicebot.intron.health/voicebot/v1/workflows/123e4567-e89b-12d3-a456-426614174000' \
                        --header 'Content-Type: application/json' \
                        --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
                        --data '{
                            "name": "Updated Integrator Workflow",
                            "description": "Updated workflow description V2",
                            "workflow_type": "ROBOCALL",
                            "message": "Hello [name], your appointment is scheduled for [date] at [time]",
                            "include_reply": true,
                            "option_one": "Reply 1",
                            "option_two": "Reply 2",
                            "call_back_url": "https://new_integrator_call_back_url/:callback"
                        }'
                    
                
                    
                        import requests

                        url = "https://voicebot.intron.health/voicebot/v1/workflows/123e4567-e89b-12d3-a456-426614174000"

                        payload = {
                            "name": "Updated Integrator Workflow",
                            "description": "Updated workflow description V2",
                            "workflow_type": "ROBOCALL",
                            "message": "Hello [name], your appointment is scheduled for [date] at [time]",
                            "include_reply": true,
                            "option_one": "Reply 1",
                            "option_two": "Reply 2",
                            "call_back_url": "https://integrator_call_back_url/:callback"
                        }
                        headers = {
                            "Authorization": "Bearer YOUR_ACCESS_TOKEN"
                        }

                        response = requests.request("PUT", url, headers=headers, json=payload)

                        print(response.json)
                    
                
                    
                        const requestOptions = {
                            method: "PUT",
                            headers: {
                                'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
                            },
                            body: JSON.stringify({
                                "name": "Updated Integrator Workflow",
                                "description": "Updated workflow description V2",
                                "workflow_type": "ROBOCALL",
                                "message": "Hello [name], your appointment is scheduled for [date] at [time]",
                                "include_reply": true,
                                "option_one": "Reply 1",
                                "option_two": "Reply 2",
                                "call_back_url": "https://integrator_call_back_url/:callback"
                            })
                        };
                            
                        fetch("https://voicebot.intron.health/voicebot/v1/workflows/123e4567-e89b-12d3-a456-426614174000", requestOptions)
                        .then((response) => response.text())
                        .then((result) => console.log(result))
                        .catch((error) => console.error(error));
                    
                
                    
                        {
                            "status": "Ok",
                            "message": "workflow updated successfully",
                            "data": {
                                "id": "123e4567-e89b-12d3-a456-426614174000",
                                "name": "Updated Integrator Workflow",
                                "description": "Updated workflow description V2",
                                "workflow_type": "ROBOCALL",
                                "message": "Hello [name], your appointment is scheduled for [date] at [time]",
                                "include_reply": true,
                                "option_one": "Reply 1",
                                "option_two": "Reply 2",
                                "call_back_url": "https://new_integrator_call_back_url/:callback"
                            }
                        }
                    
                

Delete Workflow

DELETE https://voicebot.intron.health/voicebot/v1/workflows/
:workflow_id

Delete an existing workflow.

Path Variables

Field Type Description Required Default Options
workflow_id String The unique identifier of the workflow to delete yes

Example Request and Response

                    
                        curl --location --request DELETE 'https://voicebot.intron.health/voicebot/v1/workflows/123e4567-e89b-12d3-a456-426614174000' \
                        --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
                    
                
                    
                        import requests

                        url = "https://voicebot.intron.health/voicebot/v1/workflows/123e4567-e89b-12d3-a456-426614174000"
                        headers = {
                            "Authorization": "Bearer YOUR_ACCESS_TOKEN"
                        }

                        response = requests.request("DELETE", url, headers=headers)

                        print(response.json)
                    
                
                    
                        const requestOptions = {
                            method: "DELETE",
                            headers: {
                                'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
                            }
                        };
                            
                        fetch("https://voicebot.intron.health/voicebot/v1/workflows/123e4567-e89b-12d3-a456-426614174000", requestOptions)
                        .then((response) => response.text())
                        .then((result) => console.log(result))
                        .catch((error) => console.error(error));
                    
                
                    
                        {
                            "status": "Ok",
                            "message": "workflow deleted successfully",
                            "data": {}
                        }
                    
                

List Workflow Requests

GET https://voicebot.intron.health/voicebot/v1/workflows/
:workflow_id/requests

Retrieve a list of all requests for a specific workflow.

Query Parameters

Field Type Description Required Default
page Integer Page number for pagination no 1
per_page Integer Number of items per page no 10

Example Request and Response

curl --location 'https://voicebot.intron.health/voicebot/v1/workflows/123/requests?page=1&per_page=10' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
import requests

url = "https://voicebot.intron.health/voicebot/v1/workflows/123/requests"
params = {
    "page": 1,
    "per_page": 10
}
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
}

response = requests.request("GET", url, headers=headers, params=params)
print(response.json())
const requestOptions = {
    method: "GET",
    headers: {
        'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
    }
};

fetch("https://voicebot.intron.health/voicebot/v1/workflows/123/requests?page=1&per_page=10", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
{
    "status": "Ok",
    "message": "workflow requests retrieved successfully",
    "data": {
        "items": [
            {
                "id": "550e8400-e29b-41d4-a716-446655440000",
                "status": "COMPLETED",
                "input_parameters": {
                    "tts_voice_accent": "en-US",
                    "tts_voice_gender": "female",
                    "workflow_params": [
                        {
                            "phone_number": "+1234567890",
                            "user_tag_identifiers": {"customer_id": "CUST001"},
                            "workflow_variables": {
                                "name": "John Doe"
                            }
                        }
                    ]
                },
                "created_at": "2024-03-20T10:30:00Z"
            }
        ],
        "total": 25,
        "page": 1,
        "per_page": 10,
        "stats": {
            "total_calls": 100,
            "completed_calls": 80,
            "timeout_calls": 10,
            "replied_calls": 70,
            "avg_duration": 45.5,
            "success_rate": 80.0
        }
    }
}

List Workflow Calls

GET https://voicebot.intron.health/voicebot/v1/workflows/
:workflow_id/calls

Retrieve a list of all calls for a specific workflow.

Query Parameters

Field Type Description Required Default
page Integer Page number for pagination no 1
per_page Integer Number of items per page no 10
batch_id String Filter calls by batch ID no
status String Filter calls by status no
phone_number String Filter calls by phone number no

Example Request and Response

curl --location 'https://voicebot.intron.health/voicebot/v1/workflows/123/calls?page=1&per_page=10&batch_id=550e8400-e29b-41d4-a716-446655440000&status=COMPLETED&phone_number=+1234567890' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
import requests

url = "https://voicebot.intron.health/voicebot/v1/workflows/123/calls"
params = {
    "page": 1,
    "per_page": 10,
    "batch_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "COMPLETED",
    "phone_number": "+1234567890"
}
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
}

response = requests.request("GET", url, headers=headers, params=params)
print(response.json())
const requestOptions = {
    method: "GET",
    headers: {
        'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
    }
};

fetch("https://voicebot.intron.health/voicebot/v1/workflows/123/calls?page=1&per_page=10&batch_id=550e8400-e29b-41d4-a716-446655440000&status=COMPLETED&phone_number=+1234567890", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
{
    "status": "Ok",
    "message": "workflow calls retrieved successfully",
    "data": {
        "items": [
            {
                "id": "550e8400-e29b-41d4-a716-446655440001",
                "batch_id": "550e8400-e29b-41d4-a716-446655440000",
                "status": "COMPLETED",
                "phone_number": "+1234567890",
                "user_tag_identifiers": {"customer_id": "CUST001"},
                "call_result_duration": 45,
                "call_result_options_selected": "1",
                "created_at": "2024-03-20T10:30:05Z"
            }
        ],
        "total": 100,
        "page": 1,
        "per_page": 10
    }
}

Workflow Message Requirements

  • The message length after replacing variables must not exceed 1000 characters
  • Use [parameter_name] syntax to insert dynamic values in your message
  • Example: "Hello [name], your appointment is scheduled for [date] at [time]"
  • To accept a reply, include a reply instruction at the end of your message template (e.g. Send 1 to confirm, 2 to cancel). Reply can either be the number 1 or 2.

Quotas and Limits

  • Rate limit: 60 requests per hour
  • Rate limit: 6 requests per minute