All pages
Powered by GitBook
1 of 5

Loading...

Loading...

Loading...

Loading...

Loading...

PUT v1/schemas

The following endpoint allows you to update a data schema by ID.

POST v1/schemas

The following endpoint allows you to describe a data schema for parsing an online PDF to JSON.

GET v1/schemas

The following endpoint allows you to list data schemas for your account in a paged list.

Beta Endpoints

The following features are currently in beta and only avaialble to select users. If you are interested in trying out any of these features, please contact support and we can enable them for you.

JSON Data Parsing

Allows you to describe a JSON data schema for your data and then convert an online PDF into this data format using AI.

Endpoints:

POST v1/schemas
PUT v1/schemas
DELETE v1/schemas/{id}
GET v1/schemas

DELETE v1/schemas/{id}

The following endpoint allows you to delete a schema from your account.

Update an existing data schema

put

Updates an existing data schema by its ID and returns the updated schema.

Authorizations
Path parameters
idstringRequired
Body
idstring | nullableOptional

The unique identifier for the data schema.

namestring | nullableOptional

The name of the schema or field.

descriptionstring | nullableOptional

A description of the schema or field.

Responses
200
Payload of DataSchema
application/json
put
PUT /v1/schemas/{id} HTTP/1.1
Host: api.gaffa.dev
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1082

"{\"name\":\"Updated Product Schema\",\"description\":\"Enhanced schema for product information with additional fields\",\"fields\":[{\"type\":\"string\",\"name\":\"productName\",\"description\":\"Name of the product\",\"fields\":[]},{\"type\":\"decimal\",\"name\":\"price\",\"description\":\"Product price\",\"fields\":[]},{\"type\":\"boolean\",\"name\":\"inStock\",\"description\":\"Whether the product is in stock\",\"fields\":[]},{\"type\":\"array\",\"name\":\"tags\",\"description\":\"Product tags\",\"fields\":[{\"type\":\"string\",\"name\":\"tagItem\",\"description\":null,\"fields\":[]}]},{\"type\":\"array\",\"name\":\"categories\",\"description\":\"Product categories\",\"fields\":[{\"type\":\"string\",\"name\":\"category\",\"description\":null,\"fields\":[]}]},{\"type\":\"object\",\"name\":\"specifications\",\"description\":\"Technical specifications\",\"fields\":[{\"type\":\"string\",\"name\":\"dimensions\",\"description\":\"Product dimensions\",\"fields\":[]},{\"type\":\"double\",\"name\":\"weight\",\"description\":\"Product weight in grams\",\"fields\":[]}]}]}"
200

Payload of DataSchema

{
  "id": "text",
  "name": "text",
  "description": "text",
  "fields": [
    {
      "type": 0,
      "name": "text",
      "description": "text",
      "fields": [
        {
          "type": 0,
          "name": "text",
          "description": "text",
          "fields": [
            "[Circular Reference]"
          ]
        }
      ]
    }
  ]
}

Create a new data schema

post

Creates a new data schema definition and returns the created schema.

Authorizations
Body
idstring | nullableOptional

The unique identifier for the data schema.

namestring | nullableOptional

The name of the schema or field.

descriptionstring | nullableOptional

A description of the schema or field.

Responses
200
Payload of DataSchema
application/json
post
POST /v1/schemas HTTP/1.1
Host: api.gaffa.dev
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 518

"{\"name\":\"Customer Schema\",\"description\":\"Data schema for customer information\",\"fields\":[{\"type\":\"string\",\"name\":\"firstName\",\"description\":\"Customer's first name\",\"fields\":[]},{\"type\":\"string\",\"name\":\"lastName\",\"description\":\"Customer's last name\",\"fields\":[]},{\"type\":\"integer\",\"name\":\"age\",\"description\":\"Customer's age in years\",\"fields\":[]},{\"type\":\"boolean\",\"name\":\"isActive\",\"description\":\"Whether the customer account is active\",\"fields\":[]}]}"
200

Payload of DataSchema

{"id":"schema_abc123def456","name":"Customer Schema","description":"Data schema for customer information","fields":[{"type":"string","name":"firstName","description":"Customer's first name","fields":[]},{"type":"string","name":"lastName","description":"Customer's last name","fields":[]},{"type":"integer","name":"age","description":"Customer's age in years","fields":[]},{"type":"boolean","name":"isActive","description":"Whether the customer account is active","fields":[]}]}

List data schemas

get

Retrieves a paginated list of data schemas.

Authorizations
Query parameters
pageSizeinteger · int32Optional
pageinteger · int32Optional
Responses
200
Payload of PagedResult containing DataSchema
application/json
get
GET /v1/schemas HTTP/1.1
Host: api.gaffa.dev
X-API-Key: YOUR_API_KEY
Accept: */*
200

Payload of PagedResult containing DataSchema

{"data":{"total_pages":1,"total_records":3,"results":[{"id":"schema_abc123def456","name":"Customer Schema","description":"Data schema for customer information","fields":[{"type":"string","name":"firstName","description":"Customer's first name","fields":[]},{"type":"string","name":"lastName","description":"Customer's last name","fields":[]},{"type":"integer","name":"age","description":"Customer's age in years","fields":[]},{"type":"boolean","name":"isActive","description":"Whether the customer account is active","fields":[]}]},{"id":"schema_xyz789uvw123","name":"Product Schema","description":"Data schema for product information","fields":[{"type":"string","name":"productName","description":"Name of the product","fields":[]},{"type":"decimal","name":"price","description":"Product price","fields":[]},{"type":"boolean","name":"inStock","description":"Whether the product is in stock","fields":[]},{"type":"array","name":"tags","description":"Product tags","fields":[{"type":"string","name":"tagItem","description":null,"fields":[]}]}]},{"id":"schema_hij456klm789","name":"Order Schema","description":"Data schema for order processing","fields":[{"type":"string","name":"orderId","description":"Unique order identifier","fields":[]},{"type":"datetime","name":"orderDate","description":"Date when order was placed","fields":[]},{"type":"object","name":"customer","description":"Customer information","fields":[{"type":"string","name":"customerId","description":"Customer identifier","fields":[]},{"type":"string","name":"email","description":"Customer email address","fields":[]}]},{"type":"decimal","name":"totalAmount","description":"Total order amount","fields":[]}]}],"page":1,"page_size":30},"error":null,"httpCode":0}

Delete a data schema

delete

Deletes a data schema by its ID.

Authorizations
Path parameters
idstringRequired
Responses
204
No description
delete
DELETE /v1/schemas/{id} HTTP/1.1
Host: api.gaffa.dev
X-API-Key: YOUR_API_KEY
Accept: */*
204

No description

No content