Skip to content
StatusSupportDashboard

Update namespace settings

data.update_settings(strnamespace, DataUpdateSettingsParams**kwargs) -> DataUpdateSettingsResponse
PUT/v1/data/{namespace}/settings

Create or replace settings for a namespace, primarily used to change the schema associated with the namespace.

ParametersExpand Collapse
namespace: str

The namespace to ingest data into

schema: Dict[str, Schema]

Schema mapping field names to their definitions. Use content_type to specify which fields contain URLs that should be processed (images, videos, or websites), datetime fields, or 'metadata' for fields that should be stored but not indexed. Use display_hint to provide UI rendering hints.

content_type: Optional[Literal["image_url", "video_url", "website_url", 2 more]]

The type of content (image_url, video_url, website_url, datetime, or metadata). When specified as a URL type, SafetyKit will process the URL. Use 'metadata' for fields that should be stored but not indexed.

One of the following:
"image_url"
"video_url"
"website_url"
"datetime"
"metadata"
display_hint: Optional[SchemaDisplayHint]

Display hint for UI rendering of this field

type: Literal["title", "subtitle", "description", 13 more]

The display hint type

One of the following:
"title"
"subtitle"
"description"
"primary_image_url"
"video_url"
"location"
"compact_text"
"markdown"
"html"
"email.reply_to"
"email.body"
"email.subject"
"email.body_image"
"email.logo_image"
"email.event"
"email.footer"
field_limit: Optional[int]

Maximum amount of this field to include when sending to AI models. For text fields, this is the character limit. For array fields (e.g. image URLs), this is the maximum number of items.

minimum0
exclusiveMinimum
namespace_ref: Optional[str]

The namespace which an id refers to, creating a parent-child relationship with that namespace.

ReturnsExpand Collapse
class DataUpdateSettingsResponse:

Namespace configuration was stored.

namespace: str
status: Literal["updated"]

Update namespace settings

import os
from safetykit import Safetykit

client = Safetykit(
    api_key=os.environ.get("SAFETYKIT_API_KEY"),  # This is the default and can be omitted
)
response = client.data.update_settings(
    namespace="namespace",
    schema={
        "profile_image": {},
        "cover_photo": {},
        "website": {},
    },
)
print(response.namespace)
{
  "namespace": "users",
  "status": "updated"
}
Returns Examples
{
  "namespace": "users",
  "status": "updated"
}