# PayAI Batch Migration Safety Preflight

> PayAI Batch Migration Safety Preflight is a paid API for AI agents from payai.agentstools.dev, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-15).

Runs safety preflight checks on multiple database migration SQL files at once, returning per-file pass/caution/block verdicts and a rollup summary.

## Facts

- Endpoint: POST https://payai.agentstools.dev/migrate/batch
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/payai-batch-migration-safety-preflight-ac891363
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hEpCMc_c2Af4CqMKsto23

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability payai-batch-migration-safety-preflight-ac891363 -d '<json body>'
```

Example prompt: Can you safety-check these three migration files for me before I deploy? File 1 is called 'add_user_index' with SQL 'CREATE INDEX ...', File 2 is 'drop_old_column' with SQL 'ALTER TABLE users DROP COLUMN legacy_id', and File 3 is 'rename_table' with SQL 'ALTER TABLE orders RENAME TO orders_v2' — I need to know which ones are safe, which need caution, and which I should block.

## When to prefer this

Use this endpoint when you need to safety-check multiple database migration SQL files in a single call, especially in CI/CD pipelines or pre-deployment workflows where batch throughput matters. Prefer this over single-file validation when you have 2 or more migrations to check simultaneously and want a consolidated rollup verdict alongside per-file results.

## Known failure modes

- Empty or malformed migration list returns an error
- Invalid or unparseable SQL may result in an error or conservative block verdict
- Missing required fields (name or SQL) per migration object cause validation errors
- Very large batches may hit payload or timeout limits
- Network or service errors return non-200 status codes

## How this service works

Batch safety preflight for many database migrations at once: a list of objects each with a name and migration SQL. Returns a per-file pass, caution or block verdict plus a rollup with the worst verdict and counts. Migration-safety indicators, not a guarantee.

## Output

Returns a list of per-file results each containing the migration name and a verdict of pass, caution, or block, along with a rollup object summarizing the worst overall verdict across all files and counts of how many files fell into each verdict category. These are migration-safety indicators, not guarantees.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "format": {
   "enum": [
    "sql",
    "alembic",
    "auto"
   ],
   "type": "string",
   "description": "Default input format for entries that do not set one"
  },
  "dialect": {
   "enum": [
    "postgres",
    "mysql"
   ],
   "type": "string",
   "description": "Default dialect for entries that do not set one"
  },
  "migrations": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "List of objects, each with name and migration SQL"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/payai-batch-migration-safety-preflight-ac891363/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payai.agentstools.dev](https://www.zero.xyz/host/payai.agentstools.dev/llms.txt)
