Skip to content

Notion: Retrieve a data source

Notion dataSources.retrieveADataSource: arguments, response, policy and SDK examples.

← Data sources operations · Get started

Operation notion.retrieve_a_data_source

Provider route: GET /v1/data_sources/{data_source_id}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/notion with npm, or alter-sdk-notion with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { NotionIntegration } from "@alter-ai/notion";
async function execute(input: Parameters<NotionIntegration["dataSources"]["retrieveADataSource"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new NotionIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.dataSources.retrieveADataSource(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_notion import NotionIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = NotionIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.data_sources.retrieve_a_data_source(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.data_source_idstringRequired within parentID of a Notion data source.

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)ModelAlternativeExpand Create a data source — response body — object data source — partial Data Source Object Response
$ (anyOf 2)ModelAlternativeExpand Create a data source — response body — object data source — data Source Object Response

Referenced models: Create a data source — response body — object data source — data Source Object Response, Create a data source — response body — object data source — partial Data Source Object Response

69 more schemas are linked from the tables above, on the schema pages.

Create a data source — response body — object data source — data Source Object Response
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: allowed
coverJSONRequired within parentThe cover of the data source.
cover (anyOf 1)ModelAlternativeExpand Update page — response body — object page cover value
cover (anyOf 2)nullAlternative
created_byModelRequired within parentExpand Update page — response body — object page created by
The user who created the data source.
created_timestringRequired within parentThe time when the data source was created.
Format: date-time
database_parentModelRequired within parentExpand Create a database — response body — object database parent
The parent of the data source's containing database. This is typically a page, block, or workspace, but can be another database in the case of wikis.
database_typeJSONRequired within parentThe type of typed database this data source belongs to, or `null` for a regular data source.
database_type (anyOf 1)stringAlternativeOne of: `tasks`, `projects`, `sprints`, `docs`, `wiki`, `meetings`, `meeting_notes`, `skills`, `github_prs`
Known values: tasks, projects, sprints, docs, wiki, meetings, meeting_notes, skills, github_prs
database_type (anyOf 2)nullAlternative
descriptionarrayRequired within parentThe description of the data source.
Maximum items: 100
description[]ModelEach itemExpand Retrieve a page property item — response body — value Title title
iconJSONRequired within parentThe icon of the data source.
icon (anyOf 1)ModelAlternativeExpand Get agent — response body — icon value
icon (anyOf 2)nullAlternative
idstringRequired within parentThe ID of the data source.
Format: uuid
in_trashbooleanRequired within parentWhether the data source is in the trash.
is_inlinebooleanRequired within parentWhether the data source is inline.
last_edited_byModelRequired within parentExpand Update page — response body — object page created by
The user who last edited the data source.
last_edited_timestringRequired within parentThe time when the data source was last edited.
Format: date-time
objectstringRequired within parentThe data source object type name.
Must equal: data_source
parentModelRequired within parentExpand Create a data source — response body — object data source parent
The parent of the data source.
propertiesobjectRequired within parentThe properties schema of the data source.
Additional keys: see wildcard field
properties.*ModelAdditional keysExpand Create a data source — response body — object data source properties value
public_urlJSONRequired within parentThe public URL of the data source if it is publicly accessible.
public_url (anyOf 1)stringAlternative
public_url (anyOf 2)nullAlternative
sync_metadataobjectOptionalSync identity and available health, included when listing or retrieving data sources.
Additional keys: allowed
sync_metadata.external_collection_typestringOptionalThe provider of a legacy synced data source: Jira or Salesforce. Values are case-sensitive.
Known values: Jira, Salesforce
sync_metadata.external_database_syncobjectOptionalStored identity of an external database sync.
Additional keys: allowed
sync_metadata.external_database_sync.providerstringRequired within parentThe sync provider: github (GitHub), jira (Jira), or salesforce (Salesforce).
Known values: github, jira, salesforce
sync_metadata.external_database_sync.sync_idstringRequired within parentThe stored sync ID. This is not a credential.
Format: uuid
sync_metadata.healthJSONOptionalLive collection sync health. Null means unavailable, not unhealthy. Missing timestamps are unknown.
sync_metadata.health (anyOf 1)nullAlternative
sync_metadata.health (anyOf 2)ModelAlternativeExpand Create a data source — response body — object data_source / sync_metadata / health / ok False, stage: backfilling, initializing, steady
sync_metadata.health (anyOf 3)ModelAlternativeExpand Create a data source — response body — object data_source / sync_metadata / health / ok True, stage: backfilling, initializing, steady
sync_metadata.health (anyOf 4)objectAlternativeAdditional keys: allowed
sync_metadata.health (anyOf 4).pausedbooleanRequired within parentMust equal: true
sync_metadata.owner_user_idstringOptionalNotion user who owns the sync credential, included when health is available.
Format: uuid
sync_metadata.resourcestringOptionalProvider resource synced to this data source, when available.
sync_metadata.sync_idstringOptionalThe stored sync ID when provider details are unavailable. This is not a credential.
Format: uuid
sync_metadata.sync_stateModelOptionalExpand Create a data source — response body — object data source sync metadata sync state
sync_metadata.synced_collection_keystringOptionalOpaque, developer-defined collection key for a worker sync. It is not a globally unique ID or a credential. Worker status is not included.
titlearrayRequired within parentThe title of the data source.
Maximum items: 100
title[]ModelEach itemExpand Retrieve a page property item — response body — value Title title
urlstringRequired within parentThe URL of the data source.

Referenced models: Create a data source — response body — object data source properties value, Update page — response body — object page cover value, Get agent — response body — icon value, Create a data source — response body — object data source parent, Create a database — response body — object database parent, Update page — response body — object page created by, Retrieve a page property item — response body — value Title title, Create a data source — response body — object data_source / sync_metadata / health / ok False, stage: backfilling, initializing, steady, Create a data source — response body — object data_source / sync_metadata / health / ok True, stage: backfilling, initializing, steady, Create a data source — response body — object data source sync metadata sync state

Create a data source — response body — object data source — partial Data Source Object Response
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: allowed
idstringRequired within parentThe ID of the data source.
Format: uuid
objectstringRequired within parentThe data source object type name.
Must equal: data_source
propertiesobjectRequired within parentThe properties schema of the data source.
Additional keys: see wildcard field
properties.*ModelAdditional keysExpand Create a data source — response body — object data source properties value

Referenced models: Create a data source — response body — object data source properties value

Update page — response body — object page cover value
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)ModelAlternativeExpand Update page — response body — object page cover value File
$ (anyOf 2)ModelAlternativeExpand Update page — response body — object page cover value External

Referenced models: Update page — response body — object page cover value External, Update page — response body — object page cover value File

Create a data source — response body — object data source parent
FieldTypePresenceDescription and constraints
$JSONRootThe parent of the data source. This is typically a database (`database_id`), but for externally synced data sources, can be another data source (`data_source_id`).
$ (anyOf 1)ModelAlternativeExpand Delete a view — response body — parent
$ (anyOf 2)ModelAlternativeExpand Update page — response body — object page parent type data source id

Referenced models: Update page — response body — object page parent type data source id, Delete a view — response body — parent

Update page — response body — object page created by
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: allowed
idstringRequired within parentFormat: uuid
objectstringRequired within parentAlways `user`
Must equal: user

SDK function policy ID: notion.retrieve_a_data_source. Catalog operation: retrieve_a_data_source. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Notion-Version": "2026-03-11"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.