Backfill Citation Schema
Citation Schemas
Backfill Citation Schema
Retroactively apply one or more citation schemas to extract data from existing call transcripts.
POST
Backfill Citation Schema
Documentation Index
Fetch the complete documentation index at: https://docs.bland.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The backfill endpoint allows you to apply citation schemas to calls and SMS conversations that have already been completed. This is useful when you:- Create a new schema and want to extract data from historical calls or conversations
- Need to re-analyze calls or conversations with updated schemas
- Want to extract data from multiple calls or conversations at scale
workflow_id immediately and can poll the status endpoint to check progress. SMS conversation backfill is synchronous — results are returned directly in the response.
This is an Enterprise-only feature. Contact your Bland representative or reach out to sales to enable this functionality.
Request
Headers
Your API key for authentication.
Body Parameters
Schema Parameters (Choose One)
A single citation schema ID from your organization to apply to the call(s).
An array of citation schema IDs to apply to the call(s). All schemas will be processed for each call.Note: Cannot be combined with
schema (inline schema).An inline citation schema definition. Useful for one-time analysis without creating a schema in your account.Can be combined with
call_id/call_ids or conversation_id/conversation_ids for multi-call or multi-conversation analysis.Note: Cannot be combined with schema_ids.Call Parameters
A single call ID to analyze with the specified schema(s).
An array of call IDs to analyze with the specified schema(s). All schemas will be applied to each call.
SMS Conversation Parameters
A single SMS conversation ID to analyze with the specified schema(s). Processed synchronously.
An array of SMS conversation IDs to analyze. Maximum 50 conversations per request. All schemas will be applied to each conversation. Processed synchronously.
Response
Returns202 Accepted when calls are included (async processing), or 200 OK when only SMS conversations are included (sync processing).
"processing" when calls are being processed asynchronously, or "complete" when only SMS conversations were processed.Unique identifier for the call backfill workflow. Only present when calls are included. Use this to check status and retrieve results.
Number of calls being processed.
Number of SMS conversations processed.
Number of schemas being applied.
Total number of call+schema extractions that will be performed (
call_count × schema_count). Only present when calls are included.Results for SMS conversation backfill. Only present when conversations are included. Each entry contains:
conversation_id— the conversation that was analyzedstatus—"success","skipped", or"error"variables_extracted— count of unique variable names extracted across all schemas (same definition asresult.calls[].variables_extracted_count)previous_variables— the conversation’s citation variables before this backfill operationnewly_extracted_variables— variables that were extracted or updated by this backfill operationfinal_variables— the conversation’s citation variables after this backfill operation (complete merged state)error— error message if the extraction failed
Instructions on how to check the status of the call workflow.
Checking Status
Use the workflow ID to poll the status endpoint:Status Response
The workflow ID you’re querying.
Current workflow status:
RUNNING: Still processingCOMPLETED: Finished successfully (may have partial failures)FAILED: Workflow encountered an errorTERMINATED: Manually stoppedTIMED_OUT: Exceeded maximum execution time
Only present when
status is COMPLETED. Contains the full backfill results.Result Object (When Completed)
Overall result status:
success: All extractions succeededpartial: Some extractions succeeded, some failedfailed: All extractions failed
Array of results, one entry per call processed.
The call that was analyzed.
Status for this call:
success, partial, or failed.Details about each schema extraction for this call.
Total number of unique variables extracted across all schemas for this call.
The call’s citation variables before this backfill operation.
Variables that were extracted or updated by this backfill operation.
The call’s citation variables after this backfill operation (complete state).
Aggregate statistics across all calls and schemas:
total_calls: Number of calls processedsuccessful_calls: Calls where all schemas succeededpartial_calls: Calls where some schemas failedfailed_calls: Calls where all schemas failedtotal_schemas_processed: Total schema extractions attemptedsuccessful_schema_extractions: Schema extractions that succeededfailed_schema_extractions: Schema extractions that failed
Usage Flow
- Send backfill request and receive
workflow_id - Poll the status endpoint periodically (every 5-10 seconds)
- When status is
COMPLETED, retrieve results fromresultfield - Review the results to see what was extracted for each call
Examples
Single Call, Single Schema
Request
Response (202 Accepted)
Multiple Calls, Multiple Schemas
Request
Response (202 Accepted)
SMS Conversations
Request
Response (200 OK)
Single Call with Inline Schema
Request
Checking Status
Request
Response (Status: RUNNING)
Response (Status: COMPLETED)
Error Responses
400 Bad Request
Returned when:- No schema parameter provided (
schema_id,schema_ids, orschemarequired) - No identifier parameter provided (
call_id,call_ids,conversation_id,conversation_ids, orrecording_urlrequired) - Invalid parameter combinations (e.g.,
schema_idswith inlineschema) - Empty arrays provided
- More than 50 SMS conversations in a single request
403 Forbidden
Returned when:- Account does not have enterprise features enabled
- Attempting to access another organization’s calls, conversations, or schemas
404 Not Found
Returned when:- Specified call ID(s) not found
- Specified schema ID(s) not found
- Resources don’t belong to your organization
- None of the provided
schema_id/schema_idscan be resolved (error code:NO_RESOLVABLE_SCHEMAS)
500 Internal Server Error
Returned when an unexpected error occurs starting the workflow.Best Practices
Polling Strategy
- Poll every 5-10 seconds for single-call operations
- Poll every 10-30 seconds for batch operations
- Implement exponential backoff if polling for extended periods
- Stop polling once status is
COMPLETED,FAILED,TERMINATED, orTIMED_OUT
Batch Processing
- Process up to 100 calls at once for optimal performance
- For larger batches, split into multiple backfill requests
- Use multiple schemas in a single request rather than separate requests per schema
Error Handling
- Check the
result.calls[].statusfield for per-call results - Review
schemas_processedarray to see which schemas succeeded/failed - Use
error_summaryfield for quick diagnosis of partial failures - Failed extractions don’t prevent successful ones from being stored
Variable Management
- Newly extracted variables overwrite previous values with the same name
- Variables from different schemas are merged together
- Only variables defined in the backfilled schema are updated
- Other existing variables remain unchanged
Docs for agents: llms.txt