Configuring Schema
Describe field meaning and presentation with schema content types and display hints.
Schema tells SafetyKit how to interpret fields in your objects, and is managed as part of namespace settings. Configure schema via PUT /v1/data/{namespace}/settings.
Why schema matters
Section titled “Why schema matters”Schema improves processing quality and usability by signaling, for example:
- which fields contain media URLs, which can be extracted & scraped for further processing
- which fields are long-form text, and can be truncated when displayed
- which fields are metadata-only, and should not be indexed
- how objects should render in the SafetyKit UI
Example schema
Section titled “Example schema”{ "schema": { "title": { "display_hint": { "type": "title" } }, "description": { "display_hint": { "type": "description" } }, "images": { "content_type": "image_url", "display_hint": { "type": "primary_image_url" } }, "product_url": { "content_type": "website_url" }, "price": { "content_type": "metadata" }, "category": { "content_type": "metadata" } }}When updating schema, send it in the schema field of the PUT /settings request body.
Common content types
Section titled “Common content types”Supported content_type values (validated in Data API runtime and surfaced in the schema editor):
image_url: image URL(s) intended for analysisvideo_url: video URL(s) intended for analysiswebsite_url: URL reference(s) that should be processed as web contentdatetime: date/time fieldmetadata: structured context that should be stored but not indexed
Common display hints
Section titled “Common display hints”Supported display_hint.type values (validated in Data API runtime and surfaced in the schema editor):
title: primary row headingsubtitle: secondary textdescription: long-form textprimary_image_url: primary image fieldvideo_url: primary video fieldlocation: location fieldcompact_text: condensed text fieldmarkdown: markdown-formatted contentemail.reply_to: email reply-to fieldemail.body: email body fieldemail.subject: email subject fieldemail.body_image: image extracted from email bodyemail.logo_image: email/logo image fieldemail.event: email event fieldemail.footer: email footer field
- Keep field names stable within a namespace.
- Use consistent types for a field over time.
- Start with a minimal schema and expand as needed.
- When changing schema in production, roll out incrementally and monitor outputs for a full cycle before introducing additional field changes.