Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
251 changes: 225 additions & 26 deletions public/notion-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
"openapi": "3.1.0",
"info": {
"title": "Notion API",
"description": "API for interacting with Notion resources such as pages and databases.",
"version": "1.0.0"
},
"description": "API for interacting with Notion resources such as pages and databases.\n\n=== Version Information ===\nCurrent Version: 2024-02\nPrevious Version: 2022-06-28\n\nThis version includes enhanced features and improvements.",
"version": "2024-02",
"x-notion-version-info": {
"current": "2024-02",
"previous": "2022-06-28",
"released": "2024-02-01",
"sunset_date": "2024-08-01"
}
}
"servers": [
{
"url": "https://api.notion.com/v1",
Expand Down Expand Up @@ -213,6 +219,54 @@
"application/json": {
"schema": {
"$ref": "#/components/schemas/DatabaseQuery"
},
"examples": {
"queryByStatus": {
"summary": "Query by Status Only",
"value": {
"filter": {
"property": "Status",
"status": {
"equals": "{status_value}"
}
},
"page_size": 20
}
},
"queryByPriority": {
"summary": "Query by Priority Only",
"value": {
"filter": {
"property": "Priority",
"select": {
"equals": "{priority_value}"
}
},
"page_size": 20
}
},
"queryByStatusAndPriority": {
"summary": "Query by Status and Priority",
"value": {
"filter": {
"and": [
{
"property": "Status",
"status": {
"equals": "{status_value}"
}
},
{
"property": "Priority",
"select": {
"equals": "{priority_value}"
}
}
]
},
"page_size": 20
}
}
}
}
}
Expand All @@ -231,6 +285,51 @@
}
}
},
"/databases/{database_id}/properties/search": {
"get": {
"operationId": "searchDatabaseProperties",
"summary": "Search properties within a database.",
"parameters": [
{
"name": "database_id",
"in": "path",
"required": true,
"description": "The ID of the database whose properties to search.",
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "query",
"in": "query",
"required": true,
"description": "The property name (or partial name) to search for.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A JSON object containing matched properties.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"matched_properties": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}
},
"/search": {
"post": {
"operationId": "search",
Expand Down Expand Up @@ -432,19 +531,32 @@
"required": true,
"schema": {
"type": "string",
"default": "2022-06-28"
"default": "2024-02",
"enum": ["2024-02", "2022-06-28"],
"description": "Notion API version - Use 2024-02 for latest features"
},
"description": "Notion API version"
"description": "Notion API version (current: 2024-02)",
"x-version-history": {
"current": "2024-02",
"supported": ["2024-02", "2022-06-28"]
}
}
},
}
}
"schemas": {
"Page": {
"type": "object",
"required": ["object", "id", "properties"],
"required": [
"object",
"id",
"properties"
],
"properties": {
"object": {
"type": "string",
"enum": ["page"]
"enum": [
"page"
]
},
"id": {
"type": "string",
Expand All @@ -467,11 +579,16 @@
},
"PageCreate": {
"type": "object",
"required": ["parent", "properties"],
"required": [
"parent",
"properties"
],
"properties": {
"parent": {
"type": "object",
"required": ["database_id"],
"required": [
"database_id"
],
"properties": {
"database_id": {
"type": "string",
Expand Down Expand Up @@ -534,11 +651,16 @@
},
"Database": {
"type": "object",
"required": ["object", "id"],
"required": [
"object",
"id"
],
"properties": {
"object": {
"type": "string",
"enum": ["database"]
"enum": [
"database"
]
},
"id": {
"type": "string",
Expand All @@ -552,11 +674,16 @@
},
"User": {
"type": "object",
"required": ["object", "id"],
"required": [
"object",
"id"
],
"properties": {
"object": {
"type": "string",
"enum": ["user"]
"enum": [
"user"
]
},
"id": {
"type": "string",
Expand All @@ -579,11 +706,16 @@
},
"Block": {
"type": "object",
"required": ["object", "id"],
"required": [
"object",
"id"
],
"properties": {
"object": {
"type": "string",
"enum": ["block"]
"enum": [
"block"
]
},
"id": {
"type": "string",
Expand All @@ -600,11 +732,16 @@
},
"Comment": {
"type": "object",
"required": ["object", "id"],
"required": [
"object",
"id"
],
"properties": {
"object": {
"type": "string",
"enum": ["comment"]
"enum": [
"comment"
]
},
"id": {
"type": "string",
Expand All @@ -621,11 +758,16 @@
},
"PagePropertyItem": {
"type": "object",
"required": ["object", "id"],
"required": [
"object",
"id"
],
"properties": {
"object": {
"type": "string",
"enum": ["property_item"]
"enum": [
"property_item"
]
},
"id": {
"type": "string",
Expand All @@ -642,24 +784,38 @@
"properties": {
"filter": {
"type": "object",
"additionalProperties": true
"additionalProperties": true,
"description": "Filter conditions for querying the database. Example for Projects DB: { \"and\": [ { \"property\": \"Status\", \"status\": { \"equals\": \"In Progress\" } }, { \"property\": \"Priority\", \"select\": { \"equals\": \"High\" } } ] }. Allowed Status values (Projects): [\"Not Started\", \"In Progress\", \"Complete\", \"On Hold\", \"Archived\"]. Allowed Priority values (Projects): [\"High\", \"Medium\", \"Low\"]. For Tasks DB, use \"Task Status\" (Allowed: [\"Not Started\", \"In Progress\", \"Complete\"]) and \"Priority\" (Allowed: [\"1: High\", \"2: Medium\", \"3: Low\"])."
},
"sorts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"page_size": {
"type": "integer",
"default": 20,
"minimum": 1,
"maximum": 100,
"description": "Number of results to return per query. Defaults to 20 to ensure at least 10-20 results are returned."
}
}
},
"description": "Schema for querying a Notion database. Use filters, sorts, and page_size to narrow down results."
},
"DatabaseRecord": {
"type": "object",
"required": ["object", "id"],
"required": [
"object",
"id"
],
"properties": {
"object": {
"type": "string",
"enum": ["database_record"]
"enum": [
"database_record"
]
},
"id": {
"type": "string",
Expand Down Expand Up @@ -691,11 +847,16 @@
},
"SearchResult": {
"type": "object",
"required": ["object", "id"],
"required": [
"object",
"id"
],
"properties": {
"object": {
"type": "string",
"enum": ["search_result"]
"enum": [
"search_result"
]
},
"id": {
"type": "string",
Expand All @@ -706,6 +867,44 @@
"additionalProperties": true
}
}
},
"ProjectStatus": {
"type": "string",
"enum": [
"Not Started",
"In Progress",
"Complete",
"On Hold",
"Archived"
],
"description": "Allowed status values for Projects DB."
},
"ProjectPriority": {
"type": "string",
"enum": [
"High",
"Medium",
"Low"
],
"description": "Allowed priority values for Projects DB."
},
"TaskStatus": {
"type": "string",
"enum": [
"Not Started",
"In Progress",
"Complete"
],
"description": "Allowed status values for Tasks DB."
},
"TaskPriority": {
"type": "string",
"enum": [
"1: High",
"2: Medium",
"3: Low"
],
"description": "Allowed priority values for Tasks DB."
}
},
"securitySchemes": {
Expand Down