Integrating forms with Notion for data collection
Notion Databases are a convenient storage for teams already working in Notion. Requests from your site automatically appear as pages in a Notion database, with all properties and the ability to comment.
Notion API
class NotionService
{
private string $apiKey;
private string $databaseId;
public function createPage(array $data): array
{
$resp = Http::withHeaders([
'Authorization' => "Bearer {$this->apiKey}",
'Notion-Version' => '2022-06-28',
'Content-Type' => 'application/json',
])->post('https://api.notion.com/v1/pages', [
'parent' => ['database_id' => $this->databaseId],
'properties' => [
'Name' => [
'title' => [['text' => ['content' => $data['name']]]]
],
'Email' => [
'email' => $data['email']
],
'Phone' => [
'phone_number' => $data['phone'] ?? ''
],
'Status' => [
'select' => ['name' => 'New']
],
'Request date' => [
'date' => ['start' => now()->toIso8601String()]
],
],
'children' => [
[
'object' => 'block',
'type' => 'paragraph',
'paragraph' => [
'rich_text' => [[
'type' => 'text',
'text' => ['content' => $data['message'] ?? '']
]]
]
]
]
]);
return $resp->json();
}
}
Setting up Notion Integration
- Create an Integration at
https://www.notion.so/my-integrations - Copy Internal Integration Token
- In your Notion database: Settings → Connections → add integration
- Copy Database ID from the database URL
Limitations
- Notion API has rate limit: 3 requests per second
- With high traffic — queue with Redis
- Notion doesn't support webhooks for notifications (need polling or integration via Zapier/Make)
Implementation time: 1–2 working days.







