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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Retrieve a user — response body |
Referenced models: Retrieve a user — response body
Schemas
Section titled “Schemas”Retrieve a user — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | object | Alternative | Additional keys: allowed |
$ (anyOf 1).agent_id | string | Optional | The 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_url | JSON | Required within parent | The avatar URL of the user. |
$ (anyOf 1).avatar_url (anyOf 1) | string | Alternative | |
$ (anyOf 1).avatar_url (anyOf 2) | null | Alternative | |
$ (anyOf 1).id | string | Required within parent | The ID of the user. Format: uuid |
$ (anyOf 1).name | JSON | Required within parent | The name of the user. |
$ (anyOf 1).name (anyOf 1) | string | Alternative | |
$ (anyOf 1).name (anyOf 2) | null | Alternative | |
$ (anyOf 1).object | string | Required within parent | The user object type name. Must equal: user |
$ (anyOf 1).person | object | Required within parent | Details about the person, when the `type` of the user is `person`. Additional keys: allowed |
$ (anyOf 1).person.email | string | Optional | The email of the person. |
$ (anyOf 1).person.email_verified | boolean | Optional | Whether the person's email is verified. |
$ (anyOf 1).type | string | Required within parent | Indicates this user is a person. Must equal: person |
$ (anyOf 2) | object | Alternative | Additional keys: allowed |
$ (anyOf 2).agent_id | string | Optional | The 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_url | JSON | Required within parent | The avatar URL of the user. |
$ (anyOf 2).avatar_url (anyOf 1) | string | Alternative | |
$ (anyOf 2).avatar_url (anyOf 2) | null | Alternative | |
$ (anyOf 2).id | string | Required within parent | The ID of the user. Format: uuid |
$ (anyOf 2).name | JSON | Required within parent | The name of the user. |
$ (anyOf 2).name (anyOf 1) | string | Alternative | |
$ (anyOf 2).name (anyOf 2) | null | Alternative | |
$ (anyOf 2).object | string | Required within parent | The user object type name. Must equal: user |
$ (anyOf 2).bot | JSON | Required within parent | Details about the bot, when the `type` of the user is `bot`. |
$ (anyOf 2).bot (anyOf 1) | Model | Alternative | Expand List views — response body — view |
$ (anyOf 2).bot (anyOf 2) | Model | Alternative | Expand Retrieve a user — response body — object user, type bot bot owner, workspace id, workspace limits, workspace name |
$ (anyOf 2).type | string | Required within parent | Indicates 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
Retrieve a user — response body — object user, type bot bot owner, workspace id, workspace limits, workspace name
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
owner | JSON | Required within parent | Details about the owner of the bot. |
owner (anyOf 1) | object | Alternative | Additional keys: allowed |
owner (anyOf 1).type | string | Required within parent | Always `user` Must equal: user |
owner (anyOf 1).user | JSON | Required within parent | Details 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) | object | Alternative | Additional keys: allowed |
owner (anyOf 1).user (anyOf 1).avatar_url | JSON | Required within parent | The avatar URL of the user. |
owner (anyOf 1).user (anyOf 1).avatar_url (anyOf 1) | string | Alternative | |
owner (anyOf 1).user (anyOf 1).avatar_url (anyOf 2) | null | Alternative | |
owner (anyOf 1).user (anyOf 1).id | string | Required within parent | The ID of the user. Format: uuid |
owner (anyOf 1).user (anyOf 1).name | JSON | Required within parent | The name of the user. |
owner (anyOf 1).user (anyOf 1).name (anyOf 1) | string | Alternative | |
owner (anyOf 1).user (anyOf 1).name (anyOf 2) | null | Alternative | |
owner (anyOf 1).user (anyOf 1).object | string | Required within parent | The user object type name. Must equal: user |
owner (anyOf 1).user (anyOf 1).person | object | Required within parent | The person info of the user. Additional keys: allowed |
owner (anyOf 1).user (anyOf 1).person.email | string | Optional | The email of the person. |
owner (anyOf 1).user (anyOf 1).person.email_verified | boolean | Optional | Whether the person's email is verified. |
owner (anyOf 1).user (anyOf 1).type | string | Required within parent | The type of the user. Must equal: person |
owner (anyOf 1).user (anyOf 2) | Model | Alternative | Expand Update page — response body — object page created by |
owner (anyOf 2) | object | Alternative | Additional keys: allowed |
owner (anyOf 2).type | string | Required within parent | Always `workspace` Must equal: workspace |
owner (anyOf 2).workspace | boolean | Required within parent | Details 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_id | string | Required within parent | The ID of the bot's workspace. |
workspace_limits | object | Required within parent | Limits and restrictions that apply to the bot's workspace Additional keys: allowed |
workspace_limits.max_file_upload_size_in_bytes | JSON | Required within parent | |
workspace_limits.max_file_upload_size_in_bytes (anyOf 1) | integer | Alternative | The maximum allowable size of a file upload, in bytes Minimum: 0 |
workspace_limits.max_file_upload_size_in_bytes (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
workspace_name | JSON | Required within parent | The name of the bot's workspace. |
workspace_name (anyOf 1) | string | Alternative | |
workspace_name (anyOf 2) | null | Alternative |
Referenced models: Update page — response body — object page created by
Update page — response body — object page created by
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
id | string | Required within parent | Format: uuid |
object | string | Required within parent | Always `user` Must equal: user |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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"}