Candidate’s phone number in E.164 format.Example: "+917873476062"
object
Key-value pairs stored on the candidate record. Values can be a string, number, or boolean. Max 50 keys. Read more about custom fields.
string
required
Behavior and script instructions for the AI agent, covering who it is, why it is calling, and how it should screen the candidate. Generate a script or write your own.Example: "You are a recruiter for {{sender_company}}. Screen the candidate about their experience with distributed systems."Supports dynamic variables like {{candidate_first_name}} and {{sender_company}}.
object
The final verdict the AI should reach about the candidate (e.g. “Qualified” / “Not Qualified”).
Show child attributes
string
required
Data type: string, boolean, single_select, or integer.Example: "single_select"
string
required
Rule the AI uses to derive this verdict from the call.Example: "Qualified if candidate scored well, has ≤30-day notice, and can relocate."
string[]
Allowed values for single_select type. Min 2 required.Example: ["Qualified", "Not Qualified", "Inconclusive"]
object[]
Data points to extract from the conversation.
Show child attributes
string
required
Human-readable name for the variable.Example: "Years of Experience"
string
required
Data type: string, single_select, boolean, integer, number, array, date, or datetime.Example: "integer"
string
required
Prompt telling the AI how to extract this value.Example: "How many years of professional experience does the candidate have?"
string
Example of the expected output format.Example: "5"
string[]
Allowed values for single_select type.Example: ["1-3", "4-6", "7-10", "10+"]
string
ISO 8601 datetime to schedule the call. Call starts immediately if omitted.Example: "2026-05-27T10:00:00Z"
object
Retry policy, working hours, and WhatsApp notification settings. See Call Settings for a complete explanation with examples.
Show child attributes
object
When to retry failed calls. No retries if omitted.
Show child attributes
string[]
required
Call outcomes that trigger a retry: missed, declined, sent_to_voicemail, silenced, abruptly_disconnected.Example: ["missed", "declined"]
object[]
When retries should happen. Uses default timing if omitted.
object
Restrict when calls can be placed. Each day takes a start_time and end_time in 12-hour format (e.g. "09:00 AM"). Omit a day to disallow calls that day.Example:
WhatsApp templates sent around the AI call: pre_call before the call and fallback if the call fails and cannot be retried. Each takes template_name (approved WhatsApp template) and template_variables (supports {{candidate_first_name}} etc.).
string
The first thing the AI says when the candidate picks up. Defaults to "Hello".Example: "Hello {{candidate_first_name}}, this is {{sender_company}} calling."Supports the same dynamic variables as instructions.
object
Defaults to a female English voice. Assistant name is Ria, uses Indian accent with no background effects. Book a call with the team to customize.
string
Call flow. Defaults to direct.Example: "direct"
Value
Description
direct
Schedule and trigger calls immediately. Respects schedule_at
whatsapp
Candidate opt-in flow — call is created in call_scheduled state but not triggered until the candidate accepts a WhatsApp message. schedule_at is ignored
boolean
Schedule calls even if the candidate already has an active or scheduled call for the same job.Example: false
Response
AI calls initiated successfully
boolean
Indicates if the request was successful. Example: true
object
Show child attributes
string
Project ID. Example: "64a1b2c3d4e5f6a7b8c9d0e1"
string
Dashboard URL for the project.
object[]
Per-candidate results.
Show child attributes
string
Transaction ID for the scheduled call. Omitted if the call failed.
string
Candidate ID from your system.
string
Candidate name (title-cased).
string
Candidate email. Omitted if not provided.
string
Phone number used for the call.
string
Per-candidate status: success or failed.
string
Status details.
string
Scheduled time of the call. Omitted if immediate or failed.
Common Errors
200 (success: false)
400 Bad Request
401 Unauthorized
422 Validation Error
Reason: Every candidate failed processing — the request succeeded but no calls were initiated.
{ "success": false, "data": { "project_id": "64a1b2c3d4e5f6a7b8c9d0e1", "project_url": "https://platform.tidyhire.app/app/projects/64a1b2c3", "calls": [ { "candidate_id": "ats-cand-777", "name": "Conflict Phone", "phone": "+917873476062", "status": "failed", "message": "A candidate with this phone already exists with a different ID" } ] }}
Reason: The request body is not valid JSON, or schedule_at is not a valid future date.
{ "success": false, "message": "Invalid JSON in request body"}
{ "success": false, "message": "schedule_at must be a valid future date"}
Reason: Missing or invalid x-tidyhire-api-key header.
{ "success": false, "message": "Unauthorized, Please reach out at support@tidyhire.app"}
Reason: Missing or invalid fields — each entry in errors points to a specific field.
{ "success": false, "message": "Validation error: Candidate's phone must be in E.164 format (e.g. +917873476062)", "errors": [ { "path": "candidates[0].phone", "message": "Candidate's phone must be in E.164 format (e.g. +917873476062)" } ]}
{ "success": false, "message": "Validation error: single_select disposition requires at least 2 choices", "errors": [ { "path": "disposition", "message": "single_select disposition requires at least 2 choices" } ]}
Was this page helpful?
⌘I
curl --request POST \ --url https://api.tidyhire.app/api/public/v1/call/initiate \ --header 'x-tidyhire-api-key: <token>' \ --header 'Content-Type: application/json' \ --data '{ "ats_job_id": "ats-job-12345", "candidates": [ { "id": "ats-candidate-001", "name": "John Doe", "email": "john.doe@example.com", "phone": "+917873476062" } ], "instructions": "You are a recruiter for {{sender_company}}. Screen the candidate about their experience with distributed systems.", "disposition": { "type": "single_select", "description": "Qualified if candidate scored well, has ≤30-day notice, and can relocate.", "choices": ["Qualified", "Not Qualified", "Inconclusive"] }}'
import requestsurl = "https://api.tidyhire.app/api/public/v1/call/initiate"headers = { "x-tidyhire-api-key": "<token>", "Content-Type": "application/json"}payload = { "ats_job_id": "ats-job-12345", "candidates": [ { "id": "ats-candidate-001", "name": "John Doe", "email": "john.doe@example.com", "phone": "+917873476062" } ], "instructions": "You are a recruiter for {{sender_company}}. Screen the candidate about their experience with distributed systems.", "disposition": { "type": "single_select", "description": "Qualified if candidate scored well, has ≤30-day notice, and can relocate.", "choices": ["Qualified", "Not Qualified", "Inconclusive"] }}response = requests.post(url, json=payload, headers=headers)print(response.json())
fetch('https://api.tidyhire.app/api/public/v1/call/initiate', { method: 'POST', headers: { 'x-tidyhire-api-key': '<token>', 'Content-Type': 'application/json', }, body: JSON.stringify({ ats_job_id: 'ats-job-12345', candidates: [ { id: 'ats-candidate-001', name: 'John Doe', email: 'john.doe@example.com', phone: '+917873476062', }, ], instructions: 'You are a recruiter for {{sender_company}}. Screen the candidate about their experience with distributed systems.', disposition: { type: 'single_select', description: 'Qualified if candidate scored well, has ≤30-day notice, and can relocate.', choices: ['Qualified', 'Not Qualified', 'Inconclusive'], }, }),}) .then((response) => response.json()) .then((data) => console.log(data)) .catch((error) => console.error('Error:', error));
<?php$url = 'https://api.tidyhire.app/api/public/v1/call/initiate';$data = [ 'ats_job_id' => 'ats-job-12345', 'candidates' => [ [ 'id' => 'ats-candidate-001', 'name' => 'John Doe', 'email' => 'john.doe@example.com', 'phone' => '+917873476062' ] ], 'instructions' => 'You are a recruiter for {{sender_company}}. Screen the candidate about their experience with distributed systems.', 'disposition' => [ 'type' => 'single_select', 'description' => 'Qualified if candidate scored well, has ≤30-day notice, and can relocate.', 'choices' => ['Qualified', 'Not Qualified', 'Inconclusive'] ]];$ch = curl_init($url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'x-tidyhire-api-key: <token>', 'Content-Type: application/json']);$response = curl_exec($ch);curl_close($ch);echo $response;?>
package mainimport ( "bytes" "encoding/json" "fmt" "net/http")func main() { url := "https://api.tidyhire.app/api/public/v1/call/initiate" payload := map[string]interface{}{ "ats_job_id": "ats-job-12345", "candidates": []map[string]interface{}{ { "id": "ats-candidate-001", "name": "John Doe", "email": "john.doe@example.com", "phone": "+917873476062", }, }, "instructions": "You are a recruiter for {{sender_company}}. Screen the candidate about their experience with distributed systems.", "disposition": map[string]interface{}{ "type": "single_select", "description": "Qualified if candidate scored well, has ≤30-day notice, and can relocate.", "choices": []string{"Qualified", "Not Qualified", "Inconclusive"}, }, } jsonData, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) req.Header.Set("x-tidyhire-api-key", "<token>") req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Println("Error:", err) return } defer resp.Body.Close() fmt.Println("Response Status:", resp.Status)}
import java.io.OutputStream;import java.net.HttpURLConnection;import java.net.URL;import java.nio.charset.StandardCharsets;public class InitiateCall { public static void main(String[] args) { try { URL url = new URL("https://api.tidyhire.app/api/public/v1/call/initiate"); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestMethod("POST"); con.setRequestProperty("x-tidyhire-api-key", "<token>"); con.setRequestProperty("Content-Type", "application/json"); con.setDoOutput(true); String jsonInputString = "{\n" + " \"ats_job_id\": \"ats-job-12345\",\n" + " \"candidates\": [{\n" + " \"id\": \"ats-candidate-001\",\n" + " \"name\": \"John Doe\",\n" + " \"email\": \"john.doe@example.com\",\n" + " \"phone\": \"+917873476062\"\n" + " }],\n" + " \"instructions\": \"You are a recruiter for {{sender_company}}. Screen the candidate about their experience with distributed systems.\",\n" + " \"disposition\": {\n" + " \"type\": \"single_select\",\n" + " \"description\": \"Qualified if candidate scored well, has ≤30-day notice, and can relocate.\",\n" + " \"choices\": [\"Qualified\", \"Not Qualified\", \"Inconclusive\"]\n" + " }\n" + "}"; try (OutputStream os = con.getOutputStream()) { byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8); os.write(input, 0, input.length); } int status = con.getResponseCode(); System.out.println("Response Status: " + status); } catch (Exception e) { e.printStackTrace(); } }}
require 'net/http'require 'json'require 'uri'uri = URI('https://api.tidyhire.app/api/public/v1/call/initiate')http = Net::HTTP.new(uri.host, uri.port)http.use_ssl = truerequest = Net::HTTP::Post.new(uri.path)request['x-tidyhire-api-key'] = '<token>'request['Content-Type'] = 'application/json'request.body = { ats_job_id: 'ats-job-12345', candidates: [ { id: 'ats-candidate-001', name: 'John Doe', email: 'john.doe@example.com', phone: '+917873476062' } ], instructions: 'You are a recruiter for {{sender_company}}. Screen the candidate about their experience with distributed systems.', disposition: { type: 'single_select', description: 'Qualified if candidate scored well, has ≤30-day notice, and can relocate.', choices: ['Qualified', 'Not Qualified', 'Inconclusive'] }}.to_jsonresponse = http.request(request)puts response.body