Search by

sdkfabric / notion

chriskapp

Notion PHP SDK managed by SDK Fabric

Package info

github.com/sdk-fabric/notion-php

Homepage

pkg:composer/sdkfabric/notion

Fund package maintenance!

chriskapp

Statistics

Installs: 12 110

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v0.3.0 2026-10-03 23:39 UTC

This package is auto-updated.

Last update: 2026-10-18 18:59:25 UTC


README

This SDK is managed by the SDK Fabric project, a global infrastructure to automatically generate SDKs for every API.

You can find more information about this SDK at TypeHub: https://app.typehub.cloud/d/sdkfabric/notion

Usage

<?php

require __DIR__ . '/vendor/autoload.php';

$client = new \SdkFabric\Notion\Client::build('[access_token]');

// Creates and appends new children blocks to the parent block or page specified.
$response = $client->block()->appendChildren('Notion-Version', 'block_id', new Append_Block_Children_Request());

// Moves a block (including a page) to the trash.
$response = $client->block()->delete('Notion-Version', 'block_id');

// Retrieves a Block object using the ID specified.
$response = $client->block()->get('Notion-Version', 'block_id');

// Returns a paginated array of child block objects contained in the block (or page) using the ID specified.
$response = $client->block()->getChildren('Notion-Version', 'block_id', 1, 'start_cursor');

// Updates the content of a block based on its type, or moves it to/from the trash.
$response = $client->block()->update('Notion-Version', 'block_id', new Update_Block_Request());

// Creates an additional data source in an existing database.
$response = $client->dataSource()->create('Notion-Version', new Create_Data_Source_Request());

// Retrieves a data source object, including its property schema.
$response = $client->dataSource()->get('Notion-Version', 'data_source_id');

// Creates a database and its initial data source as a child of a page or the workspace.
$response = $client->database()->create('Notion-Version', new Create_Database_Request());

// Retrieves a database object, a container for one or more data sources, for a provided database ID.
$response = $client->database()->get('Notion-Version', 'database_id');

// Updates the attributes (title, description, icon, cover, parent, inline, trash and lock status) of a database.
$response = $client->database()->update('Notion-Version', 'database_id', new Update_Database_Request());

// Creates a new page as a child of an existing page or data source.
$response = $client->page()->create('Notion-Version', 'filter_properties', new Create_Page_Request());

// Retrieves a Page object using the ID specified.
$response = $client->page()->get('Notion-Version', 'filter_properties', 'page_id');

// Retrieves the content of a page rendered as enhanced markdown.
$response = $client->page()->getMarkdown('Notion-Version', true, 'page_id');

// Retrieves a page property item.
$response = $client->page()->getProperty('Notion-Version', 'page_id', 1, 'property_id', 'start_cursor');

// Moves an existing page to a new parent page or data source.
$response = $client->page()->move('Notion-Version', 'page_id', new Move_Page_Request());

// Updates page properties, icon, cover, lock state or trash status (in_trash).
$response = $client->page()->update('Notion-Version', 'filter_properties', 'page_id', new Update_Page_Request());

// Updates or replaces content in a page using enhanced markdown.
$response = $client->page()->updateMarkdown('Notion-Version', 'page_id', new Update_Page_Markdown_Request());

// Retrieves a User using the ID specified.
$response = $client->user()->get('Notion-Version', 'user_id');

// Returns a paginated list of Users for the workspace.
$response = $client->user()->getAll('Notion-Version', 1, 'start_cursor');

// Retrieves the bot User associated with the API token provided in the authorization header.
$response = $client->user()->getMe('Notion-Version');