Stifler | Notion GPT

Stifler | Notion GPT · Ações GPT

Notion API

API for interacting with Notion's pages, databases, and users.

  • GET /usersList all users
  • GET /blocks/{block_id}/childrenRetrieve block children
  • GET /commentsRetrieve comments
  • GET /pages/{page_id}/properties/{property_id}Retrieve a page property item
  • POST /databases/{database_id}/queryQuery a database
  • POST /searchSearch
Esquema API original
{
  "openapi": "3.1.0",
  "info": {
    "title": "Notion API",
    "description": "API for interacting with Notion's pages, databases, and users.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.notion.com/v1",
      "description": "Main Notion API server"
    }
  ],
  "paths": {
    "/users": {
      "get": {
        "operationId": "listAllUsers",
        "summary": "List all users",
        "parameters": [
          {
            "name": "Notion-Version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2022-06-28",
            "constant": "2022-06-28"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "avatar_url": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/blocks/{block_id}/children": {
      "get": {
        "operationId": "retrieveBlockChildren",
        "summary": "Retrieve block children",
        "parameters": [
          {
            "name": "block_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Notion-Version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2022-06-28",
            "constant": "2022-06-28"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "has_children": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/comments": {
      "get": {
        "operationId": "retrieveComments",
        "summary": "Retrieve comments",
        "parameters": [
          {
            "name": "Notion-Version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2022-06-28",
            "constant": "2022-06-28"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "created_time": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "created_by": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/pages/{page_id}/properties/{property_id}": {
      "get": {
        "operationId": "retrievePagePropertyItem",
        "summary": "Retrieve a page property item",
        "parameters": [
          {
            "name": "page_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "property_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Notion-Version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2022-06-28",
            "constant": "2022-06-28"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "text": {
                            "type": "object",
                            "properties": {
                              "content": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/databases/{database_id}/query": {
      "post": {
        "operationId": "queryDatabase",
        "summary": "Query a database",
        "parameters": [
          {
            "name": "database_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Notion-Version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2022-06-28",
            "constant": "2022-06-28"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filter": {
                    "type": "object"
                  },
                  "sorts": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "start_cursor": {
                    "type": "string"
                  },
                  "page_size": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "next_cursor": {
                      "type": "string"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/search": {
      "post": {
        "operationId": "search",
        "summary": "Search",
        "parameters": [
          {
            "name": "Notion-Version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2022-06-28",
            "constant": "2022-06-28"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string"
                  },
                  "filter": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "string"
                      },
                      "property": {
                        "type": "string"
                      }
                    }
                  },
                  "sort": {
                    "type": "object",
                    "properties": {
                      "direction": {
                        "type": "string"
                      },
                      "timestamp": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "text": {
                                  "type": "object",
                                  "properties": {
                                    "content": {
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}