Skip to main content
POST
/
v1
/
task
import requests

url = 'https://api.miramace.com/v1/task'
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
payload = {
'task_type': 'SCHEDULE_APPOINTMENT',
'task': 'Schedule a follow-up appointment with Dr. Smith for next week',
'phone_number': '+15555555555',
'project_id': '123e4567-e89b-12d3-a456-426614174000',
'patient_id': '123e4567-e89b-12d3-a456-426614174001',
'task_data': {
'timeframe_availability': 'Weekdays between 2-5pm',
'speciality_preferences': 'Orthopedic surgeon, preferably Dr. Smith',
'additional_context': 'Patient prefers afternoon appointments',
'previous_visits': [{
'purpose': 'Initial consultation for knee pain',
'date': '2024-03-15',
'outcome': 'Recommended physical therapy and follow-up'
}],
'patient_status': 'existing',
'has_referral': true,
'referral': {
'name': 'Dr. Robert Johnson',
'npi': '0987654321',
'specialty': 'Primary Care',
'facility': 'SF Medical Group',
'address': {
'street_name': '456 Health Ave',
'city': 'San Francisco',
'state': 'CA',
'postal_code': '94105',
'country_code': 'US'
},
'phone_number': '+14155555556'
},
'is_rescheduling': false,
'existing_appointment': null,
'reschedule_reason': null
}
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
{
  "id": "123e4567-e89b-12d3-a456-426614174002"
}

Body

application/json
task_type
enum<string>
required

The type of task to be executed.

Note: tasks need to be enabled at the project level

Available options:
SCHEDULE_APPOINTMENT,
VERIFY_INSURANCE,
REIMBURSEMENT,
CUSTOM_TASK
task
string
required

Main task description with sufficient detail for the voice agent

Example:

"Schedule a follow-up appointment with Dr. Smith for next week"

phone_number
string
required

The phone number in E.164 format (e.g., +15555555555)

Example:

"+15555555555"

project_id
string<uuid>
required

UUID of the project this task belongs to

Example:

"123e4567-e89b-12d3-a456-426614174000"

patient_id
string<uuid>
required

UUID of the patient that this task is about

Example:

"123e4567-e89b-12d3-a456-426614174001"

task_data
Schedule Appointment Data · object

Data specific to scheduling appointments

  • Schedule Appointment Data
  • Verify Insurance Data
  • Reimbursement Data
  • Custom Task Data

Response

Task created successfully

id
string<uuid>

UUID of the created task

Example:

"123e4567-e89b-12d3-a456-426614174002"