Skip to main content

Destination

Nexla's bi-directional connectors allow data to flow both to and from any location, making it simple to create a FlexFlow, DB-CDC, Spark ETL, or Replication data flow that sends data to a Notion API location.
notion_api.png

Notion Api

Create a Notion API Destination

  1. Click the + icon on the Nexset that will be sent to the Notion API destination, and select the Send to Destination option from the menu.

  2. Select the Notion API connector from the list of available destination connectors. Then, select the credential that will be used to connect to your Notion workspace, and click Next; or, create a new Notion API credential for use in this flow.

  3. In Nexla, Notion API destinations can be created using pre-built endpoint templates, which expedite destination setup for common Notion API endpoints. Each template is designed specifically for the corresponding Notion API endpoint, making destination configuration easy and efficient.
    • To configure this destination using a template, follow the instructions in Configure Using a Template.

    Notion API destinations can also be configured manually, allowing you to send data to Notion API endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this destination manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure destinations to send data to common Notion API endpoints. Each template is designed specifically for the corresponding Notion API endpoint, making destination setup easy and efficient.

  • To configure this destination using a template, select the endpoint to which data will be sent from the Endpoint pulldown menu. Then, click on the template in the list below to expand it, and follow the instructions to configure additional endpoint settings.

    Create a Comment

    This endpoint template creates a new comment on a Notion page or block. Use this template when you need to add comments to Notion pages, database entries, or blocks from your data flow.

    • This endpoint automatically creates comments from your data. No additional configuration is required beyond selecting this endpoint template. The request body should contain the comment data in JSON format, including the block ID and comment content.

    This endpoint sends data as JSON in the request body to create a new comment in your Notion workspace. The request body should contain the comment data, including the block ID (the page or block where the comment will be added) and the comment content (rich text).

    For detailed information about creating comments, request body formats, and available comment properties, see the Notion API documentation.

    Create Page

    This endpoint template creates a new page in your Notion workspace. Use this template when you need to create new Notion pages, database entries, or content from your data flow.

    • This endpoint automatically creates pages from your data. No additional configuration is required beyond selecting this endpoint template. The request body should contain the page data in JSON format, including the parent (database or page), page properties, and content.

    This endpoint sends data as JSON in the request body to create a new page in your Notion workspace. The request body should contain the page data, including the parent (where the page will be created), page properties (title, content, etc.), and any additional page configuration.

    For detailed information about creating pages, request body formats, available page properties, and content structures, see the Notion API documentation.

Configure Manually

Notion API destinations can be manually configured to send data to any valid Notion API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

Using manual configuration, you can also configure Nexla to automatically send the response received from the Notion API after each call to a new Nexla webhook data source.

API Method

  1. To manually configure this destination, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the Notion API from the Method pulldown menu. Notion API typically uses POST method for creating resources, PATCH method for updating resources, and DELETE method for deleting resources.

Data Format

  1. Select the format in which the Nexset data will be sent to the Notion API from the Content Format pulldown menu. Notion API expects JSON format for all requests.

API Endpoint URL

  1. Enter the URL of the Notion API endpoint to which data will be sent in the URL field. This should be the complete URL to your Notion API endpoint (e.g., https://api.notion.com/v1/pages, https://api.notion.com/v1/comments). Include any required query parameters in the URL.

Ensure the API endpoint URL is correct and accessible with your current credentials. The Notion API endpoint URL should point to the endpoint where you want to create or update resources. You can test the endpoint using the Test button after configuring the URL.

Request Body

  1. Configure the request body that will be sent to the Notion API. The request body should contain the resource data formatted as JSON, with field names matching the Notion API's expected structure. The request body format is typically {message.json} to send the entire Nexset data as JSON, or you can construct a custom JSON structure with specific field mappings.

The request body must be valid JSON and must match the Notion API's expected format for the specific endpoint you're using. Notion API uses a specific structure for pages, comments, and other resources. For detailed information about request body formats, available endpoints, and resource structures, see the Notion API documentation.

Save the Destination

  1. Once all of the relevant steps in the above sections have been completed, click the Next button to proceed with the rest of the data flow configuration, or click Save to save the destination configuration for later use.