> ## Documentation Index
> Fetch the complete documentation index at: https://docs.luly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch Details

> Retrieves calls and batch data for a specific batch_id.

### Headers

<ParamField header="authorization" type="string" required={true}>
  Your API key for authentication.
</ParamField>

### Path Parameters

<ParamField path="batch_id" type="string" required={true}>
  The unique identifier for the batch of calls you want to retrieve.
</ParamField>

### Query Parameters

<ParamField query="include_calls" type="boolean">
  Whether or not to include individual call data in the response.
</ParamField>

<ParamField query="include_transcripts" type="boolean">
  If calls are included, can be set to false to exclude transcripts from the response.
</ParamField>

<ParamField query="include_analysis" type="boolean">
  If calls are included, can be set to false to exclude analysis from the response.
</ParamField>

### Response

<ResponseField name="status" type="string">
  The status of the batch. Possible values are in-progress and completed.

  -in-progress: The batch is still in progress.
  -completed: Every call in the batch has completed.
</ResponseField>

<ResponseField name="batche_params" type="object">
  An object containing parameters and settings for the batch.
</ResponseField>

<ResponseField name="batch_params.id" type="string">
  The unique identifier of the batch - used as the batch\_id parameter in other API calls.
</ResponseField>

<ResponseField name="batch_params.created_at" type="string">
  The creation timestamp of the batch.
</ResponseField>

<ResponseField name="batch_params.label" type="string">
  The label or description of the batch.
</ResponseField>

<ResponseField name="batch_params.base_prompt" type="string">
  The base prompt used for calls in this batch.
</ResponseField>

<ResponseField name="batch_params.endpoint_code" type="string">
  The endpoint code used for API integration.
</ResponseField>

<ResponseField name="batch_params.call_params" type="object">
  An object containing parameters for the calls in the batch.
</ResponseField>

<ResponseField name="analysis" type="object">
  An object containing analysis data for the batch.
</ResponseField>

<ResponseField name="analysis.total_calls" type="object">
  The total number of calls in the batch, including completed and in-progress calls.
</ResponseField>

<ResponseField name="analysis.completed_calls" type="object">
  The total number of completed calls in the batch.
</ResponseField>

<ResponseField name="analysis.in_progress_calls" type="object">
  The total number of in-progress calls in the batch.
</ResponseField>

<ResponseField name="analysis.queue_statuses" type="object">
  An object containing the number of calls in each queue status.

  Example:

  ```
  {
    "complete": 237,
    "queued": 2,
    "call_error": 1
  }
  ```
</ResponseField>

<ResponseField name="analysis.call_lengths" type="object">
  Contains average, average\_nonzero, summary and all fields.

  * average: The average call length in minutes.
  * average\_nonzero: The average call length in minutes, excluding calls with a length of less than one second.
  * summary: A summary of the call lengths, grouped into ranges.
  * all: Contains each call length, in case you want to use a different grouping than the default.
</ResponseField>

<ResponseField name="analysis.call_ids" type="array">
  Contains each call\_id in the batch.
</ResponseField>

<ResponseField name="analysis.error_messages" type="array">
  Contains any error messages that calls in the batch may have.

  Example:

  ```
  [
    {
      "call_id": "c52f5f8c-147e-478c-4b40-88214feeba29",
      "error_message": "Cannot transfer to +12223334444 - Call is no longer active"
    }
  ]
  ```
</ResponseField>

<ResponseField name="analysis.endpoints" type="object">
  Contains the number of calls that have been sent to each endpoint. Applicable only to API integrations.
</ResponseField>

<ResponseField name="call_data" type="array">
  An array of objects, each representing individual call data.
</ResponseField>

<ResponseField name="call_data[].created_at" type="string">
  The timestamp when the individual call was created.
</ResponseField>

<ResponseField name="call_data[].to" type="string">
  The phone number the call was made to.
</ResponseField>

<ResponseField name="call_data[].from" type="string">
  The phone number the call was made from.
</ResponseField>

<ResponseField name="call_data[].completed" type="boolean">
  Indicates if the call was completed.
</ResponseField>

<ResponseField name="call_data[].call_id" type="string">
  The unique identifier for each individual call.
</ResponseField>

<ResponseField name="call_data[].call_length" type="number">
  The duration of the call in minutes.
</ResponseField>

<ResponseField name="call_data[].answered_by" type="array">
  Contains a string value if the batch had answered\_by\_enabled set to true.

  Values:

  * voicemail
  * human
  * unknown
  * no-answer
  * null
</ResponseField>

<ResponseExample>
  ```json Response
  {
    "status": "success",
    "pathway_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1"
  }

  ```
</ResponseExample>
