Perception

Save an extraction schema

- Access: only this account can see or use it. - Changes: schemas can't be edited. Add a version instead. - Retention: the schema, with every version, is kept until you delete it or close your account. - Retries: a retried create saves a second schema.

POST
/v1/extraction-schemas
  • Access: only this account can see or use it.
  • Changes: schemas can't be edited. Add a version instead.
  • Retention: the schema, with every version, is kept until you delete it or close your account.
  • Retries: a retried create saves a second schema.

Other errors (413, 500, 502, 503) are on Errors.

Authorization

bearerAuth
AuthorizationBearer <token>

Your API key, sent as Authorization: Bearer nace_sk_...

  • Where: the dashboard's API Keys page. It is shown once, when you create it.
  • Format: nace_sk_ followed by 43 URL-safe characters (A-Z, a-z, 0-9, _ and -).
  • Limit: an account can hold at most 3 active keys.
  • Wrong or missing key: returns 401 authentication_error.

In: header

Request Body

application/json

namestringrequired
Length1 <= length <= 128
descriptionstring
Length1 <= length <= 2000
schemaobjectrequired

The JSON Schema of the fields to extract, as schema takes it on an extract.

Show child attributes

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/extraction-schemas" \  -H "Content-Type: application/json" \  -d '{    "name": "invoice",    "description": "Invoice header fields",    "schema": {      "type": "object",      "properties": {        "invoice_number": {          "type": "string"        },        "total": {          "type": "number"        }      }    }  }'
{  "schema_id": "string",  "name": "string",  "description": "string",  "version": 1,  "owner": "account",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "schema": {}}