curl -X POST 'https://api.anyformat.ai/v3/extractions/0699a1c2-e14c-7606-8000-2ee4fb17b4fd/rows/add/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{ "sanitized_name": "holdings", "index": 2 }'
from anyformat.sdk import Client
client = Client(api_key="YOUR_API_KEY")
client.add_row("0699a1c2-e14c-7606-8000-2ee4fb17b4fd", 2, sanitized_name="holdings")
import { Anyformat } from "@anyformat/sdk";
const af = new Anyformat({ apiKey: "YOUR_API_KEY" });
await af.addRow("0699a1c2-e14c-7606-8000-2ee4fb17b4fd", 2, { sanitizedName: "holdings" });
Corrections
Add Row
Insert an empty row into a table of an extraction
POST
/
v3
/
extractions
/
{extraction_id}
/
rows
/
add
/
curl -X POST 'https://api.anyformat.ai/v3/extractions/0699a1c2-e14c-7606-8000-2ee4fb17b4fd/rows/add/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{ "sanitized_name": "holdings", "index": 2 }'
from anyformat.sdk import Client
client = Client(api_key="YOUR_API_KEY")
client.add_row("0699a1c2-e14c-7606-8000-2ee4fb17b4fd", 2, sanitized_name="holdings")
import { Anyformat } from "@anyformat/sdk";
const af = new Anyformat({ apiKey: "YOUR_API_KEY" });
await af.addRow("0699a1c2-e14c-7606-8000-2ee4fb17b4fd", 2, { sanitizedName: "holdings" });
Rate limit tier: general, 600 requests/min. See Rate limits.
Inserts an empty row into a table field of one extraction and answers
204 No Content. extraction_id is the id of an entry of results.extractions in Get run. The rows from index on move down by one. Fill the new row with Edit field, naming each cell by sanitized_name, column and row_index.
Name the table by its key in the results (sanitized_name) or by its persistent_id, not both. A field’s persistent_id is the one Get workflow returns for it. index is a position from 0 up to the number of rows; a larger one answers 400, as does a name that reaches a field with no rows.
The call is not idempotent: a retry inserts another row. After a timeout, read the run before you retry.
Errors
| Status | error_code | When |
|---|---|---|
400 | VALIDATION_ERROR | The body names no table, names it twice, or lacks index; or index is larger than the number of rows, or the name reaches a field that is not a table. |
403 | NOT_ASSIGNED_VERIFIER | Another user is the assigned verifier of the document. |
403 | insufficient_api_key_scope | The API key has no write scope. |
404 | NOT_FOUND | params.resource_type is extraction (unknown, or in another organization), field (no field has that sanitized_name) or data_row (no table has that persistent_id). An extraction_id or a persistent_id that is not a UUID also answers 404, without params. |
curl -X POST 'https://api.anyformat.ai/v3/extractions/0699a1c2-e14c-7606-8000-2ee4fb17b4fd/rows/add/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{ "sanitized_name": "holdings", "index": 2 }'
from anyformat.sdk import Client
client = Client(api_key="YOUR_API_KEY")
client.add_row("0699a1c2-e14c-7606-8000-2ee4fb17b4fd", 2, sanitized_name="holdings")
import { Anyformat } from "@anyformat/sdk";
const af = new Anyformat({ apiKey: "YOUR_API_KEY" });
await af.addRow("0699a1c2-e14c-7606-8000-2ee4fb17b4fd", 2, { sanitizedName: "holdings" });
Authorizations
API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.
Path Parameters
Body
application/json
Body for POST /v3/extractions/{extraction_id}/rows/add/ and .../rows/delete/.
A position in the table, from 0. add_row accepts 0 up to the number of rows, and a larger one is refused with 400. delete_row needs a row at that position.
Required range:
x >= 0Example:
2
The table's key in results.extractions[].fields. Name the table by this or by persistent_id, not both.
Example:
"holdings"
The table's own persistent_id, not a column's. Name the table by this or by sanitized_name, not both.
Example:
"0686bb978c3070f0800097669e00aaaa"
Response
Successful Response

