Skip to content

dataSourceSchema

const dataSourceSchema: ZodObject<{ cover: ZodNullable<ZodDiscriminatedUnion<[ZodObject<{ file: ZodObject<{ expiry_time: ZodUnion<readonly […, …]>; url: ZodURL; }, $strip>; type: ZodLiteral<"file">; }, $strip>, ZodObject<{ file_upload: ZodObject<{ id: ZodUUID; }, $strip>; type: ZodLiteral<"file_upload">; }, $strip>, ZodObject<{ external: ZodObject<{ url: ZodURL; }, $strip>; type: ZodLiteral<"external">; }, $strip>], "type">>; created_by: ZodUnion<readonly [ZodObject<{ avatar_url: ZodOptional<ZodUnion<readonly [ZodURL, ZodNull]>>; id: ZodUUID; name: ZodOptional<ZodString>; object: ZodLiteral<"user">; person: ZodObject<{ email: ZodEmail; email_verified: ZodOptional<ZodBoolean>; }, $strip>; type: ZodLiteral<"person">; }, $strip>, ZodObject<{ avatar_url: ZodOptional<ZodUnion<readonly [ZodURL, ZodNull]>>; bot: ZodObject<{ owner: ZodDiscriminatedUnion<[ZodObject<…, …>, ZodObject<…, …>], "type">; workspace_id: ZodOptional<ZodString>; workspace_limits: ZodOptional<ZodObject<{ max_file_upload_size_in_bytes: …; }, $strip>>; workspace_name: ZodOptional<ZodNullable<ZodString>>; }, $strip>; id: ZodUUID; name: ZodOptional<ZodString>; object: ZodLiteral<"user">; type: ZodLiteral<"bot">; }, $strip>, ZodObject<{ id: ZodUUID; object: ZodLiteral<"user">; }, $strip>]>; created_time: ZodUnion<readonly [ZodISODateTime, ZodISODate]>; database_parent: ZodDiscriminatedUnion<[ZodObject<{ database_id: ZodUUID; type: ZodLiteral<"database_id">; }, $strip>, ZodObject<{ data_source_id: ZodUUID; database_id: ZodUUID; type: ZodLiteral<"data_source_id">; }, $strip>, ZodObject<{ page_id: ZodUUID; type: ZodLiteral<"page_id">; }, $strip>, ZodObject<{ type: ZodLiteral<"workspace">; workspace: ZodLiteral<true>; }, $strip>, ZodObject<{ block_id: ZodUUID; type: ZodLiteral<"block_id">; }, $strip>, ZodObject<{ agent_id: ZodUUID; type: ZodLiteral<"agent_id">; }, $strip>], "type">; description: ZodArray<ZodDiscriminatedUnion<[ZodObject<{ annotations: ZodObject<{ bold: ZodBoolean; code: ZodBoolean; color: ZodEnum<{ blue: …; blue_background: …; brown: …; brown_background: …; default: …; gray: …; gray_background: …; green: …; green_background: …; orange: …; orange_background: …; pink: …; pink_background: …; purple: …; purple_background: …; red: …; red_background: …; yellow: …; yellow_background: …; }>; italic: ZodBoolean; strikethrough: ZodBoolean; underline: ZodBoolean; }, $strip>; href: ZodNullable<ZodURL>; plain_text: ZodString; text: ZodObject<{ content: ZodString; link: ZodNullable<ZodObject<…, …>>; }, $strip>; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ annotations: ZodObject<{ bold: ZodBoolean; code: ZodBoolean; color: ZodEnum<{ blue: …; blue_background: …; brown: …; brown_background: …; default: …; gray: …; gray_background: …; green: …; green_background: …; orange: …; orange_background: …; pink: …; pink_background: …; purple: …; purple_background: …; red: …; red_background: …; yellow: …; yellow_background: …; }>; italic: ZodBoolean; strikethrough: ZodBoolean; underline: ZodBoolean; }, $strip>; href: ZodNullable<ZodURL>; mention: ZodDiscriminatedUnion<[ZodObject<{ database: …; type: …; }, $strip>, ZodObject<{ date: …; type: …; }, $strip>, ZodObject<{ link_preview: …; type: …; }, $strip>, ZodObject<{ page: …; type: …; }, $strip>, ZodObject<{ template_mention: …; type: …; }, $strip>, ZodObject<{ type: …; user: …; }, $strip>], "type">; plain_text: ZodString; type: ZodLiteral<"mention">; }, $strip>, ZodObject<{ annotations: ZodObject<{ bold: ZodBoolean; code: ZodBoolean; color: ZodEnum<{ blue: …; blue_background: …; brown: …; brown_background: …; default: …; gray: …; gray_background: …; green: …; green_background: …; orange: …; orange_background: …; pink: …; pink_background: …; purple: …; purple_background: …; red: …; red_background: …; yellow: …; yellow_background: …; }>; italic: ZodBoolean; strikethrough: ZodBoolean; underline: ZodBoolean; }, $strip>; equation: ZodObject<{ expression: ZodString; }, $strip>; href: ZodNullable<ZodURL>; plain_text: ZodString; type: ZodLiteral<"equation">; }, $strip>], "type">>; icon: ZodNullable<ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{ file: ZodObject<{ expiry_time: …; url: …; }, $strip>; type: ZodLiteral<"file">; }, $strip>, ZodObject<{ file_upload: ZodObject<{ id: …; }, $strip>; type: ZodLiteral<"file_upload">; }, $strip>, ZodObject<{ external: ZodObject<{ url: …; }, $strip>; type: ZodLiteral<"external">; }, $strip>], "type">, ZodObject<{ emoji: ZodString; type: ZodLiteral<"emoji">; }, $strip>, ZodObject<{ icon: ZodObject<{ color: ZodOptional<ZodEnum<…>>; name: ZodString; }, $strip>; type: ZodLiteral<"icon">; }, $strip>, ZodObject<{ custom_emoji: ZodObject<{ id: ZodUUID; name: ZodOptional<ZodString>; url: ZodOptional<ZodURL>; }, $strip>; type: ZodLiteral<"custom_emoji">; }, $strip>]>>; id: ZodUUID; in_trash: ZodBoolean; is_inline: ZodBoolean; last_edited_by: ZodUnion<readonly [ZodObject<{ avatar_url: ZodOptional<ZodUnion<readonly [ZodURL, ZodNull]>>; id: ZodUUID; name: ZodOptional<ZodString>; object: ZodLiteral<"user">; person: ZodObject<{ email: ZodEmail; email_verified: ZodOptional<ZodBoolean>; }, $strip>; type: ZodLiteral<"person">; }, $strip>, ZodObject<{ avatar_url: ZodOptional<ZodUnion<readonly [ZodURL, ZodNull]>>; bot: ZodObject<{ owner: ZodDiscriminatedUnion<[ZodObject<…, …>, ZodObject<…, …>], "type">; workspace_id: ZodOptional<ZodString>; workspace_limits: ZodOptional<ZodObject<{ max_file_upload_size_in_bytes: …; }, $strip>>; workspace_name: ZodOptional<ZodNullable<ZodString>>; }, $strip>; id: ZodUUID; name: ZodOptional<ZodString>; object: ZodLiteral<"user">; type: ZodLiteral<"bot">; }, $strip>, ZodObject<{ id: ZodUUID; object: ZodLiteral<"user">; }, $strip>]>; last_edited_time: ZodUnion<readonly [ZodISODateTime, ZodISODate]>; object: ZodLiteral<"data_source">; parent: ZodDiscriminatedUnion<[ZodObject<{ database_id: ZodUUID; type: ZodLiteral<"database_id">; }, $strip>, ZodObject<{ data_source_id: ZodUUID; database_id: ZodUUID; type: ZodLiteral<"data_source_id">; }, $strip>, ZodObject<{ page_id: ZodUUID; type: ZodLiteral<"page_id">; }, $strip>, ZodObject<{ type: ZodLiteral<"workspace">; workspace: ZodLiteral<true>; }, $strip>, ZodObject<{ block_id: ZodUUID; type: ZodLiteral<"block_id">; }, $strip>, ZodObject<{ agent_id: ZodUUID; type: ZodLiteral<"agent_id">; }, $strip>], "type">; properties: ZodRecord<ZodString, ZodDiscriminatedUnion<[ZodObject<{ checkbox: ZodObject<{ }, $strip>; description: ZodOptional<ZodString>; id: ZodString; name: ZodString; type: ZodLiteral<"checkbox">; }, $strip>, ZodObject<{ created_by: ZodObject<{ }, $strip>; description: ZodOptional<ZodString>; id: ZodString; name: ZodString; type: ZodLiteral<"created_by">; }, $strip>, ZodObject<{ created_time: ZodObject<{ }, $strip>; description: ZodOptional<ZodString>; id: ZodString; name: ZodString; type: ZodLiteral<"created_time">; }, $strip>], "type">>; public_url: ZodUnion<readonly [ZodURL, ZodNull]>; title: ZodArray<ZodDiscriminatedUnion<[ZodObject<{ annotations: ZodObject<{ bold: ZodBoolean; code: ZodBoolean; color: ZodEnum<{ blue: …; blue_background: …; brown: …; brown_background: …; default: …; gray: …; gray_background: …; green: …; green_background: …; orange: …; orange_background: …; pink: …; pink_background: …; purple: …; purple_background: …; red: …; red_background: …; yellow: …; yellow_background: …; }>; italic: ZodBoolean; strikethrough: ZodBoolean; underline: ZodBoolean; }, $strip>; href: ZodNullable<ZodURL>; plain_text: ZodString; text: ZodObject<{ content: ZodString; link: ZodNullable<ZodObject<…, …>>; }, $strip>; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ annotations: ZodObject<{ bold: ZodBoolean; code: ZodBoolean; color: ZodEnum<{ blue: …; blue_background: …; brown: …; brown_background: …; default: …; gray: …; gray_background: …; green: …; green_background: …; orange: …; orange_background: …; pink: …; pink_background: …; purple: …; purple_background: …; red: …; red_background: …; yellow: …; yellow_background: …; }>; italic: ZodBoolean; strikethrough: ZodBoolean; underline: ZodBoolean; }, $strip>; href: ZodNullable<ZodURL>; mention: ZodDiscriminatedUnion<[ZodObject<{ database: …; type: …; }, $strip>, ZodObject<{ date: …; type: …; }, $strip>, ZodObject<{ link_preview: …; type: …; }, $strip>, ZodObject<{ page: …; type: …; }, $strip>, ZodObject<{ template_mention: …; type: …; }, $strip>, ZodObject<{ type: …; user: …; }, $strip>], "type">; plain_text: ZodString; type: ZodLiteral<"mention">; }, $strip>, ZodObject<{ annotations: ZodObject<{ bold: ZodBoolean; code: ZodBoolean; color: ZodEnum<{ blue: …; blue_background: …; brown: …; brown_background: …; default: …; gray: …; gray_background: …; green: …; green_background: …; orange: …; orange_background: …; pink: …; pink_background: …; purple: …; purple_background: …; red: …; red_background: …; yellow: …; yellow_background: …; }>; italic: ZodBoolean; strikethrough: ZodBoolean; underline: ZodBoolean; }, $strip>; equation: ZodObject<{ expression: ZodString; }, $strip>; href: ZodNullable<ZodURL>; plain_text: ZodString; type: ZodLiteral<"equation">; }, $strip>], "type">>; url: ZodURL; }, $strip>

Defined in: src/schemas/dataSource.schema.ts:21

Notion data source object schema.

Data sources are individual tables of data that live under a Notion database. As of API version 2025-09-03, data sources have their own API endpoints.

Notion API reference: https://developers.notion.com/reference/data-source