> For a complete page index of the Captain API documentation, fetch https://docs.captain.dev/llms.txt?excludeSpec=true

# Algolia Add Object

POST https://acme.captain.dev/1/indexes/{index}
Content-Type: application/json

Add one object, with a Captain write key. Captain uses the object's `objectID`, or assigns one when it has none, and answers 201 with it.

Reference: https://docs.captain.dev/reference/product-search/algolia-compatibility/algolia-add-object

## Authentication

- `x-algolia-api-key` header (required) — A Captain key, as Algolia clients send it: a search key for queries, a write key for writes.
- `x-algolia-application-id` header (required) — Any value; the hostname selects the tenant.

## Request

### Path parameters

- `index` (string, required)

## Response

### 201

added

## Examples

**Request**

```json
{
  "objectID": "sku-11020",
  "title": "Targhee III Waterproof Mid Boot",
  "brand": "KEEN",
  "price": 150
}
```

**Response**

```json
{
  "createdAt": "2026-10-02T19:29:58.640Z",
  "taskID": 1854,
  "objectID": "sku-11020"
}
```

**SDK Code**

```python Python REST
import json
import requests

BASE_URL = "https://acme.captain.dev"
API_KEY = "your_write_key"
INDEX = "products"

headers = {
    "x-algolia-api-key": API_KEY,
    "x-algolia-application-id": "acme",
    "Content-Type": "application/json",
}

response = requests.post(
    f"{BASE_URL}/1/indexes/{INDEX}",
    headers=headers,
    json={
        "objectID": "sku-11020",
        "title": "Targhee III Waterproof Mid Boot",
        "brand": "KEEN",
        "price": 150.0,
    },
    timeout=30.0,
)

print(json.dumps(response.json(), indent=2))
```

```typescript TypeScript REST
const BASE_URL = "https://acme.captain.dev";
const API_KEY = "your_write_key";
const index = "products";

const response = await fetch(`${BASE_URL}/1/indexes/${index}`, {
  method: "POST",
  headers: {
    "x-algolia-api-key": API_KEY,
    "x-algolia-application-id": "acme",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    objectID: "sku-11020",
    title: "Targhee III Waterproof Mid Boot",
    brand: "KEEN",
    price: 150.0,
  }),
});

const result = await response.json();
console.log(JSON.stringify(result, null, 2));
```