Skip to main content

Endpoint

GET https://api.graine.ai/api/v1/batches/{batch_id}/export.csv Downloads all contacts in a batch as a CSV file. The file includes every call_variables key from the uploaded contact data plus operational result columns.

Path Parameters

ParameterTypeRequiredDescription
batch_idstringYesBatch to export

Headers

HeaderRequiredDescription
AuthorizationYesBearer gat_<token>

Response

Content-Type: text/csv The CSV columns are dynamic — the contact data columns come from the call_variables keys you uploaded.

Fixed columns (always present)

ColumnDescription
phone_numberE.164 phone number
statusFinal contact status
retry_countNumber of retry attempts
follow_up_countNumber of follow-up calls
last_attempted_atTimestamp of last call attempt
next_retry_atWhen next retry fires (empty if terminal)
last_call_statusOutcome of the most recent call attempt
last_execution_idExecution ID of the most recent call
last_completed_atCompletion timestamp of most recent call
last_duration_secondsCall duration in seconds
last_recording_urlRecording URL (if available)
last_hangup_byWho ended the call: assistant or user
last_hangup_reasonHangup reason string
last_total_costCost in USD
last_summaryAI-generated call summary

Dynamic columns (from your data)

The columns from call_variables of your contacts are also included. For example, if your contacts have callee_name, current_plan, renewal_date, and premium in their call_variables, those four columns appear in the CSV as well.

Example CSV

phone_number,callee_name,current_plan,renewal_date,premium,status,retry_count,last_call_status,last_duration_seconds,last_summary
+919876543210,Rajesh Sharma,Basic Health,2026-07-01,12000,completed,1,completed,142,"Customer interested in Family Floater upgrade"
+919876543211,Priya Mehta,Family Floater,2026-06-15,28000,no_answer,3,no-answer,0,

Example Request

curl "https://api.graine.ai/api/v1/batches/btc_xyz001/export.csv" \
  -H "Authorization: Bearer gat_your_token" \
  --output batch_results.csv
import requests

url = "https://api.graine.ai/api/v1/batches/btc_xyz001/export.csv"
headers = { "Authorization": "Bearer gat_your_token" }

response = requests.get(url, headers=headers)
with open("batch_results.csv", "wb") as f:
    f.write(response.content)
print("Downloaded batch_results.csv")
Export is available at any time — even mid-batch. Contacts still in-flight will show their current status (e.g. pending, dispatched).