images, PDFs, text, and webpages. This endpoint serves as the foundation for how extracted data is formatted and returned.
How It Works
- Define Your Schema: Create a JSON structure that outlines the fields and data types you want to extract.
- Use in Extraction Requests: Include the
schema_idwhen submitting data for processing. - Receive Structured Results: Flora extracts the information and returns it formatted according to your defined schema.
Creating a Valid Schema
Developers have two options for creating a valid schema in Flora:- Schema Builder Tool: For a visual, user-friendly experience, use our Schema Builder. This intuitive tool allows you to construct your schema graphically, ensuring all requirements are met without needing to write JSON manually.
- Manual JSON Creation: For those who prefer direct JSON manipulation or need more complex schemas, follow the guidelines below to craft your schema structure.
Root Structure
Your schema should be a valid JSON object with atype field set to either "array" or "object".
Array Type Schemas
For"array" type schemas:
- Include an
itemsfield defining the structure of array elements. - The
itemsfield must be an object with its owntypefield ("object"or"array"). - For
"object"type items, include apropertiesfield defining the object’s structure. - For nested
"array"type items, include anotheritemsfield.
Object Type Schemas
For"object" type schemas:
- Include a
propertiesfield defining the object’s structure. - Each property should specify its
typeand optionally include adescription.
Required Fields
Specifyrequired property in the fields to indicate which fields are required:
Example:
Best Practices
- Use clear, descriptive field names.
- Include
descriptionfor each field to improve clarity. - Keep your schema focused and avoid unnecessary complexity.
- Test your schema with sample data to ensure it captures all required information.

