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

# Get batch information

GET https://aihub.instabase.com/api/v2/batches/{batch_id}

Retrieve information about a batch.

Reference: https://docs.instabase.com/api-sdk/api-reference/batches/get-batch

## Authentication

- `Authorization` header (bearer token, required) — Bearer HTTP authentication.

## Request

### Path parameters

- `batch_id` (integer, required) — The batch ID.

### Headers

- `IB-Context` (string, optional) — Typically your organization ID. See [Authorization and context identification](/api-sdk/authorization#ib-context-header) for details.

## Response

### 200

Batch successfully retrieved.

- `id` (integer, required) — The batch ID.
- `name` (string, required) — The batch name.
- `workspace` (string, optional) — The name of the workspace in which the batch exists.
- `mount_point` (string, optional) — The name of the connected drive in which the batch is stored.
- `repo_owner` (string, optional) — The owner of the workspace (also known as the repo) in which the batch exists.
- `batch_owner` (string, optional) — Username of the user that created the batch.
- `created_at_ms` (long, optional) — When the batch was created, in Unix time milliseconds.
- `updated_at_ms` (long, optional) — When the batch was last updated, in Unix time milliseconds.
- `path_suffix` (string, optional) — Batch path suffix from the mount point.

## Errors

### 404 Not Found Error

Batch does not exist, or denied access.

- `any`

## Examples

**Response**

```json
{
  "id": 1,
  "name": "string",
  "workspace": "string",
  "mount_point": "string",
  "repo_owner": "string",
  "batch_owner": "string",
  "created_at_ms": 1,
  "updated_at_ms": 1,
  "path_suffix": "string"
}
```

**SDK Code**

```python with SDK
from aihub import AIHub

client = AIHub(
    api_root="https://aihub.instabase.com/api",
    api_key="abcdefghijklmnopqrst1234567890",
    ib_context="john.doe_acme.com"
)

batch_info = client.batches.get(batch_id=12345)

print(f"id: {batch_info.id}")
print(f"name: {batch_info.name}")

```

```python without SDK
import requests

batch_id = 12345
url = f"https://aihub.instabase.com/api/v2/batches/{batch_id}"

headers = {
    "Authorization": "Bearer abcdefghijklmnopqrst1234567890",
    "IB-Context": "john.doe_acme.com"
}

# make the GET request
response = requests.get(url, headers=headers)

# handle the response
if response.status_code == 200:
    print(f"id: {response.json()['id']}")
    print(f"name: {response.json()['name']}")
else:
    print(f"Error: {response.status_code} - {response.text}")

```

```javascript
const url = 'https://aihub.instabase.com/api/v2/batches/12345';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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://aihub.instabase.com/api/v2/batches/12345"

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

	req.Header.Add("Authorization", "Bearer <token>")

	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://aihub.instabase.com/api/v2/batches/12345")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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://aihub.instabase.com/api/v2/batches/12345")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://aihub.instabase.com/api/v2/batches/12345', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://aihub.instabase.com/api/v2/batches/12345");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://aihub.instabase.com/api/v2/batches/12345")! 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()
```