---
title: "Generate AI hooks for many leads (async batch)"
method: POST
path: "/v1/ai/hook/batch"
tags: ["AI Personalization"]
---

# Generate AI hooks for many leads (async batch)

`POST /v1/ai/hook/batch`

Creates an async job that generates a hook for each lead. The create call never charges (`X-No-Charge`); the worker bills 3 credits per successful lead. The `estimatedCost` is an affordability pre-check — insufficient balance for the whole batch returns 402. Poll `pollUrl` for per-lead results.

## Request body

- AiBatchRequest
  - `leads` AiVariableGenerateRequest[], required
    - `leadId` string, uuid, required — The lead to generate for. Must belong to the caller.
    - `locale` string — Output locale (one of the 8 supported locales).
    - `mode` 'native' | 'translate' — `native` generates directly in the target locale; `translate` generates in English then translates.

## Response `200`

Batch job created

- AiBatchResponse
  - `success` boolean
  - `data` object
    - `jobId` string, uuid
    - `status` string
    - `pollUrl` string
    - `estimatedCost` AiCost
      - `credits` integer
      - `pence` integer

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `402` — Insufficient credit balance for the request (or whole batch).
- `429` — Rate limit exceeded (1000 requests/hour/key).

---

[API](https://skmtc.net/meirra/apis/meirra-api.md) · [All operations](https://skmtc.net/meirra/apis/meirra-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/meirra/meirra-api/versions/d6c1805fc561/schema)
