> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getraya.app/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getraya.app/_mcp/server.

# Get batch details

GET https://v1.getraya.app/api/batch/{id}

Retrieves detailed information about a specific batch including contact counts. Customer ID is automatically determined from the API key.

Reference: https://docs.getraya.app/api-reference/batches/get-batch-details

## Authentication

- `X-API-Key` header (required) — API key for authentication. Example: raya_ABCD1234567890abcdef

## Request

### Path parameters

- `id` (integer, required) — The batch ID

## Response

### 200

Batch details retrieved successfully

- `id` (integer, optional)
- `name` (string, optional, nullable)
- `status` (string, optional, nullable)
- `agent_id` (string, optional)
- `created_at` (datetime, optional, nullable)
- `schedule` (BatchDetailsResponseSchedule, optional, nullable)
- `max_retries` (integer, optional)
- `concurrency` (integer, optional)
- `retry_after_hrs` (double, optional)
- `total_contacts` (integer, optional)
- `completed_contacts` (integer, optional)
- `unanswered_contacts` (integer, optional)

## Errors

### 404 Not Found Error

Batch not found or unauthorized

- `error` (string, optional)
- `message` (string, optional)

## Types

### BatchDetailsResponseSchedule

- `timezone` (string, required) — IANA timezone string
- `start_time` (string, required) — Start time in "HH:mm" format (24-hour)
- `end_time` (string, required) — End time in "HH:mm" format (24-hour)
- `days` (list of integer, required) — Array of day numbers (1=Monday, 7=Sunday)

## Examples

**Response**

```json
{
  "id": 1,
  "name": "string",
  "status": "string",
  "agent_id": "string",
  "created_at": "2024-01-15T09:30:00Z",
  "schedule": {
    "timezone": "Asia/Kolkata",
    "start_time": "09:00",
    "end_time": "18:00",
    "days": [
      1,
      2,
      3,
      4,
      5
    ]
  },
  "max_retries": 1,
  "concurrency": 1,
  "retry_after_hrs": 1.1,
  "total_contacts": 1,
  "completed_contacts": 1,
  "unanswered_contacts": 1
}
```

**SDK Code**

```python
import requests

url = "https://v1.getraya.app/api/batch/1"

headers = {"X-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://v1.getraya.app/api/batch/1';
const options = {method: 'GET', headers: {'X-API-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://v1.getraya.app/api/batch/1"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://v1.getraya.app/api/batch/1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://v1.getraya.app/api/batch/1")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://v1.getraya.app/api/batch/1', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://v1.getraya.app/api/batch/1");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://v1.getraya.app/api/batch/1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```