Generate AI Call Script
curl --request POST \
--url https://api.tidyhire.app/api/public/v1/ai/generate-script \
--header 'Content-Type: application/json' \
--header 'x-tidyhire-api-key: <api-key>' \
--data '
{
"company_name": "Acme Corp",
"prompt": "Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.",
"questions": [
"How many years of experience do you have with Node.js?",
"Have you worked with microservices architecture?"
],
"faqs": [
{
"question": "What is the salary range?",
"answer": "The range is $120k - $180k depending on experience."
},
{
"question": "Is this remote?",
"answer": "Yes, fully remote."
}
],
"end_call_on_disqualification": false
}
'import requests
url = "https://api.tidyhire.app/api/public/v1/ai/generate-script"
payload = {
"company_name": "Acme Corp",
"prompt": "Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.",
"questions": ["How many years of experience do you have with Node.js?", "Have you worked with microservices architecture?"],
"faqs": [
{
"question": "What is the salary range?",
"answer": "The range is $120k - $180k depending on experience."
},
{
"question": "Is this remote?",
"answer": "Yes, fully remote."
}
],
"end_call_on_disqualification": False
}
headers = {
"x-tidyhire-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-tidyhire-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_name: 'Acme Corp',
prompt: 'Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.',
questions: [
'How many years of experience do you have with Node.js?',
'Have you worked with microservices architecture?'
],
faqs: [
{
question: 'What is the salary range?',
answer: 'The range is $120k - $180k depending on experience.'
},
{question: 'Is this remote?', answer: 'Yes, fully remote.'}
],
end_call_on_disqualification: false
})
};
fetch('https://api.tidyhire.app/api/public/v1/ai/generate-script', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tidyhire.app/api/public/v1/ai/generate-script",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'company_name' => 'Acme Corp',
'prompt' => 'Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.',
'questions' => [
'How many years of experience do you have with Node.js?',
'Have you worked with microservices architecture?'
],
'faqs' => [
[
'question' => 'What is the salary range?',
'answer' => 'The range is $120k - $180k depending on experience.'
],
[
'question' => 'Is this remote?',
'answer' => 'Yes, fully remote.'
]
],
'end_call_on_disqualification' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-tidyhire-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tidyhire.app/api/public/v1/ai/generate-script"
payload := strings.NewReader("{\n \"company_name\": \"Acme Corp\",\n \"prompt\": \"Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.\",\n \"questions\": [\n \"How many years of experience do you have with Node.js?\",\n \"Have you worked with microservices architecture?\"\n ],\n \"faqs\": [\n {\n \"question\": \"What is the salary range?\",\n \"answer\": \"The range is $120k - $180k depending on experience.\"\n },\n {\n \"question\": \"Is this remote?\",\n \"answer\": \"Yes, fully remote.\"\n }\n ],\n \"end_call_on_disqualification\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tidyhire-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tidyhire.app/api/public/v1/ai/generate-script")
.header("x-tidyhire-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"company_name\": \"Acme Corp\",\n \"prompt\": \"Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.\",\n \"questions\": [\n \"How many years of experience do you have with Node.js?\",\n \"Have you worked with microservices architecture?\"\n ],\n \"faqs\": [\n {\n \"question\": \"What is the salary range?\",\n \"answer\": \"The range is $120k - $180k depending on experience.\"\n },\n {\n \"question\": \"Is this remote?\",\n \"answer\": \"Yes, fully remote.\"\n }\n ],\n \"end_call_on_disqualification\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tidyhire.app/api/public/v1/ai/generate-script")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tidyhire-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"company_name\": \"Acme Corp\",\n \"prompt\": \"Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.\",\n \"questions\": [\n \"How many years of experience do you have with Node.js?\",\n \"Have you worked with microservices architecture?\"\n ],\n \"faqs\": [\n {\n \"question\": \"What is the salary range?\",\n \"answer\": \"The range is $120k - $180k depending on experience.\"\n },\n {\n \"question\": \"Is this remote?\",\n \"answer\": \"Yes, fully remote.\"\n }\n ],\n \"end_call_on_disqualification\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"instructions": "You are a recruiter for Acme Corp screening candidates for the Senior Software Engineer role. Ask about their experience with distributed systems.",
"extract_variables": [
{
"label": "Years of Experience",
"type": "string",
"description": "How many years of professional experience does the candidate have?",
"format_example": "5 years",
"choices": [
"<string>"
]
}
]
}
}{
"success": false,
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"errors": [
{
"field": "candidates.0.name",
"message": "Candidate name must be at least 3 characters"
}
]
}{
"success": false,
"message": "Unauthorized",
"error": "INVALID_API_KEY"
}{
"success": false,
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests"
}{
"success": false,
"code": "UNKNOWN_ERROR",
"message": "Something went wrong."
}AI
Generate AI Call Script
Generates AI call instructions and structured data extraction plan based on company details, task prompt, questions, and FAQs.
POST
/
api
/
public
/
v1
/
ai
/
generate-script
Generate AI Call Script
curl --request POST \
--url https://api.tidyhire.app/api/public/v1/ai/generate-script \
--header 'Content-Type: application/json' \
--header 'x-tidyhire-api-key: <api-key>' \
--data '
{
"company_name": "Acme Corp",
"prompt": "Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.",
"questions": [
"How many years of experience do you have with Node.js?",
"Have you worked with microservices architecture?"
],
"faqs": [
{
"question": "What is the salary range?",
"answer": "The range is $120k - $180k depending on experience."
},
{
"question": "Is this remote?",
"answer": "Yes, fully remote."
}
],
"end_call_on_disqualification": false
}
'import requests
url = "https://api.tidyhire.app/api/public/v1/ai/generate-script"
payload = {
"company_name": "Acme Corp",
"prompt": "Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.",
"questions": ["How many years of experience do you have with Node.js?", "Have you worked with microservices architecture?"],
"faqs": [
{
"question": "What is the salary range?",
"answer": "The range is $120k - $180k depending on experience."
},
{
"question": "Is this remote?",
"answer": "Yes, fully remote."
}
],
"end_call_on_disqualification": False
}
headers = {
"x-tidyhire-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-tidyhire-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_name: 'Acme Corp',
prompt: 'Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.',
questions: [
'How many years of experience do you have with Node.js?',
'Have you worked with microservices architecture?'
],
faqs: [
{
question: 'What is the salary range?',
answer: 'The range is $120k - $180k depending on experience.'
},
{question: 'Is this remote?', answer: 'Yes, fully remote.'}
],
end_call_on_disqualification: false
})
};
fetch('https://api.tidyhire.app/api/public/v1/ai/generate-script', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tidyhire.app/api/public/v1/ai/generate-script",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'company_name' => 'Acme Corp',
'prompt' => 'Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.',
'questions' => [
'How many years of experience do you have with Node.js?',
'Have you worked with microservices architecture?'
],
'faqs' => [
[
'question' => 'What is the salary range?',
'answer' => 'The range is $120k - $180k depending on experience.'
],
[
'question' => 'Is this remote?',
'answer' => 'Yes, fully remote.'
]
],
'end_call_on_disqualification' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-tidyhire-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tidyhire.app/api/public/v1/ai/generate-script"
payload := strings.NewReader("{\n \"company_name\": \"Acme Corp\",\n \"prompt\": \"Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.\",\n \"questions\": [\n \"How many years of experience do you have with Node.js?\",\n \"Have you worked with microservices architecture?\"\n ],\n \"faqs\": [\n {\n \"question\": \"What is the salary range?\",\n \"answer\": \"The range is $120k - $180k depending on experience.\"\n },\n {\n \"question\": \"Is this remote?\",\n \"answer\": \"Yes, fully remote.\"\n }\n ],\n \"end_call_on_disqualification\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tidyhire-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tidyhire.app/api/public/v1/ai/generate-script")
.header("x-tidyhire-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"company_name\": \"Acme Corp\",\n \"prompt\": \"Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.\",\n \"questions\": [\n \"How many years of experience do you have with Node.js?\",\n \"Have you worked with microservices architecture?\"\n ],\n \"faqs\": [\n {\n \"question\": \"What is the salary range?\",\n \"answer\": \"The range is $120k - $180k depending on experience.\"\n },\n {\n \"question\": \"Is this remote?\",\n \"answer\": \"Yes, fully remote.\"\n }\n ],\n \"end_call_on_disqualification\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tidyhire.app/api/public/v1/ai/generate-script")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tidyhire-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"company_name\": \"Acme Corp\",\n \"prompt\": \"Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.\",\n \"questions\": [\n \"How many years of experience do you have with Node.js?\",\n \"Have you worked with microservices architecture?\"\n ],\n \"faqs\": [\n {\n \"question\": \"What is the salary range?\",\n \"answer\": \"The range is $120k - $180k depending on experience.\"\n },\n {\n \"question\": \"Is this remote?\",\n \"answer\": \"Yes, fully remote.\"\n }\n ],\n \"end_call_on_disqualification\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"instructions": "You are a recruiter for Acme Corp screening candidates for the Senior Software Engineer role. Ask about their experience with distributed systems.",
"extract_variables": [
{
"label": "Years of Experience",
"type": "string",
"description": "How many years of professional experience does the candidate have?",
"format_example": "5 years",
"choices": [
"<string>"
]
}
]
}
}{
"success": false,
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"errors": [
{
"field": "candidates.0.name",
"message": "Candidate name must be at least 3 characters"
}
]
}{
"success": false,
"message": "Unauthorized",
"error": "INVALID_API_KEY"
}{
"success": false,
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests"
}{
"success": false,
"code": "UNKNOWN_ERROR",
"message": "Something went wrong."
}This endpoint is AI-powered. It generates AI call instructions and a structured data extraction plan based on your company details, task prompt, questions, and FAQs.
What it returns
- instructions — AI behavior instructions for the call. These can be passed directly to the Initiate AI Call endpoint as the
instructionsfield. - extract_variables — Structured data fields the AI should extract during the call. These can be passed directly to the Initiate AI Call endpoint as the
extract_variablesfield.
Example Request
{
"company_name": "Acme Corp",
"prompt": "Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems.",
"questions": [
"How many years of experience do you have with Node.js?",
"Have you worked with microservices architecture?",
"Describe a challenging system design problem you have solved."
],
"faqs": [
{
"question": "What is the salary range?",
"answer": "The range is $120k - $180k depending on experience."
},
{
"question": "Is this remote?",
"answer": "Yes, fully remote."
},
{
"question": "What is the interview process?",
"answer": "There will be a technical round followed by a system design discussion."
}
]
}
Example Response
{
"success": true,
"data": {
"instructions": "You are a recruiter for Acme Corp screening candidates for the Senior Software Engineer role. Ask about their experience with distributed systems, Node.js, and microservices architecture. Be professional and friendly. If candidates ask about salary, mention the range is $120k - $180k depending on experience. If they ask about remote work, confirm it is fully remote.",
"extract_variables": [
{
"label": "Years of Experience",
"type": "integer",
"description": "How many years of professional experience does the candidate have?",
"format_example": "5"
},
{
"label": "Node.js Experience",
"type": "boolean",
"description": "Does the candidate have experience with Node.js?",
"format_example": "true"
},
{
"label": "Microservices Experience",
"type": "string",
"description": "Describe the candidate's experience with microservices architecture.",
"format_example": "Built and maintained a microservices-based e-commerce platform"
}
]
}
}
Authorizations
Your Tidyhire API key
Body
application/json
Name of the company.
Minimum string length:
1Example:
"Acme Corp"
The main task or goal for the AI call. Describes what the AI should accomplish.
Minimum string length:
1Example:
"Screen candidates for the Senior Software Engineer position and assess their experience with distributed systems."
Specific questions the AI should ask during the call.
Minimum string length:
1Example:
[
"How many years of experience do you have with Node.js?",
"Have you worked with microservices architecture?"
]
Frequently asked questions and their answers to help the AI respond accurately.
Show child attributes
Show child attributes
Example:
[
{
"question": "What is the salary range?",
"answer": "The range is $120k - $180k depending on experience."
},
{
"question": "Is this remote?",
"answer": "Yes, fully remote."
}
]
If true, the AI will automatically end the call when a candidate is disqualified based on screening criteria.
Example:
false
Last modified on May 28, 2026
Was this page helpful?
⌘I