Skip to content

Notion: Retrieve your token's bot user

Notion users.getSelf: arguments, response, policy and SDK examples.

← Users operations · Get started

Operation notion.get_self

Provider route: GET /v1/users/me. 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["users"]["getSelf"]>[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.users.getSelf(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.users.get_self(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed

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

FieldTypePresenceDescription and constraints
$ModelRootExpand Retrieve a user — response body

Referenced models: Retrieve a user — response body

Retrieve a user — response body
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)objectAlternativeAdditional keys: allowed
$ (anyOf 1).agent_idstringOptionalThe ID of the Custom Agent this bot acts for. Only present when the user is a Custom Agent's bot.
Format: uuid
$ (anyOf 1).avatar_urlJSONRequired within parentThe avatar URL of the user.
$ (anyOf 1).avatar_url (anyOf 1)stringAlternative
$ (anyOf 1).avatar_url (anyOf 2)nullAlternative
$ (anyOf 1).idstringRequired within parentThe ID of the user.
Format: uuid
$ (anyOf 1).nameJSONRequired within parentThe name of the user.
$ (anyOf 1).name (anyOf 1)stringAlternative
$ (anyOf 1).name (anyOf 2)nullAlternative
$ (anyOf 1).objectstringRequired within parentThe user object type name.
Must equal: user
$ (anyOf 1).personobjectRequired within parentDetails about the person, when the `type` of the user is `person`.
Additional keys: allowed
$ (anyOf 1).person.emailstringOptionalThe email of the person.
$ (anyOf 1).person.email_verifiedbooleanOptionalWhether the person's email is verified.
$ (anyOf 1).typestringRequired within parentIndicates this user is a person.
Must equal: person
$ (anyOf 2)objectAlternativeAdditional keys: allowed
$ (anyOf 2).agent_idstringOptionalThe ID of the Custom Agent this bot acts for. Only present when the user is a Custom Agent's bot.
Format: uuid
$ (anyOf 2).avatar_urlJSONRequired within parentThe avatar URL of the user.
$ (anyOf 2).avatar_url (anyOf 1)stringAlternative
$ (anyOf 2).avatar_url (anyOf 2)nullAlternative
$ (anyOf 2).idstringRequired within parentThe ID of the user.
Format: uuid
$ (anyOf 2).nameJSONRequired within parentThe name of the user.
$ (anyOf 2).name (anyOf 1)stringAlternative
$ (anyOf 2).name (anyOf 2)nullAlternative
$ (anyOf 2).objectstringRequired within parentThe user object type name.
Must equal: user
$ (anyOf 2).botJSONRequired within parentDetails about the bot, when the `type` of the user is `bot`.
$ (anyOf 2).bot (anyOf 1)ModelAlternativeExpand List views — response body — view
$ (anyOf 2).bot (anyOf 2)ModelAlternativeExpand Retrieve a user — response body — object user, type bot bot owner, workspace id, workspace limits, workspace name
$ (anyOf 2).typestringRequired within parentIndicates this user is a bot.
Must equal: bot

Referenced models: List views — response body — view, Retrieve a user — response body — object user, type bot bot owner, workspace id, workspace limits, workspace name

List views — response body — view
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: allowed
Retrieve a user — response body — object user, type bot bot owner, workspace id, workspace limits, workspace name
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: allowed
ownerJSONRequired within parentDetails about the owner of the bot.
owner (anyOf 1)objectAlternativeAdditional keys: allowed
owner (anyOf 1).typestringRequired within parentAlways `user`
Must equal: user
owner (anyOf 1).userJSONRequired within parentDetails about the owner of the bot, when the `type` of the owner is `user`. This means the bot is for a integration.
owner (anyOf 1).user (anyOf 1)objectAlternativeAdditional keys: allowed
owner (anyOf 1).user (anyOf 1).avatar_urlJSONRequired within parentThe avatar URL of the user.
owner (anyOf 1).user (anyOf 1).avatar_url (anyOf 1)stringAlternative
owner (anyOf 1).user (anyOf 1).avatar_url (anyOf 2)nullAlternative
owner (anyOf 1).user (anyOf 1).idstringRequired within parentThe ID of the user.
Format: uuid
owner (anyOf 1).user (anyOf 1).nameJSONRequired within parentThe name of the user.
owner (anyOf 1).user (anyOf 1).name (anyOf 1)stringAlternative
owner (anyOf 1).user (anyOf 1).name (anyOf 2)nullAlternative
owner (anyOf 1).user (anyOf 1).objectstringRequired within parentThe user object type name.
Must equal: user
owner (anyOf 1).user (anyOf 1).personobjectRequired within parentThe person info of the user.
Additional keys: allowed
owner (anyOf 1).user (anyOf 1).person.emailstringOptionalThe email of the person.
owner (anyOf 1).user (anyOf 1).person.email_verifiedbooleanOptionalWhether the person's email is verified.
owner (anyOf 1).user (anyOf 1).typestringRequired within parentThe type of the user.
Must equal: person
owner (anyOf 1).user (anyOf 2)ModelAlternativeExpand Update page — response body — object page created by
owner (anyOf 2)objectAlternativeAdditional keys: allowed
owner (anyOf 2).typestringRequired within parentAlways `workspace`
Must equal: workspace
owner (anyOf 2).workspacebooleanRequired within parentDetails about the owner of the bot, when the `type` of the owner is `workspace`. This means the bot is for an internal integration.
Must equal: true
workspace_idstringRequired within parentThe ID of the bot's workspace.
workspace_limitsobjectRequired within parentLimits and restrictions that apply to the bot's workspace
Additional keys: allowed
workspace_limits.max_file_upload_size_in_bytesJSONRequired within parent
workspace_limits.max_file_upload_size_in_bytes (anyOf 1)integerAlternativeThe maximum allowable size of a file upload, in bytes
Minimum: 0
workspace_limits.max_file_upload_size_in_bytes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
workspace_nameJSONRequired within parentThe name of the bot's workspace.
workspace_name (anyOf 1)stringAlternative
workspace_name (anyOf 2)nullAlternative

Referenced models: Update page — response body — object page created by

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.get_self. Catalog operation: get_self. 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.