API Token Format Change: New ntn_ Prefix for Security
What’s New?
We are excited to announce an update to our Notion Public API token format.
Starting September 25, 2024, newly generated Public API tokens will automatically use the ntn_ prefix instead of the secret_ prefix.
Why the Change?
This change is part of our ongoing efforts to improve the security of our API. By introducing the ntn_ prefix, we aim to:
- Enhance compatibility with secret scanners and other security tools, making it easier to identify and manage Notion API tokens.
- Provide a clearer distinction between Notion API tokens and other types of secrets, reducing the risk of misconfiguration and improving overall security.
What Do You Need to Do?
- New Integrations: For any new integrations, the tokens will be automatically generated with the
ntn_prefix. Simply generate your tokens as usual through the Notion API settings page. - Existing Tokens: All existing tokens with the secret_ prefix will continue to work without any changes. There is no immediate need to update your existing integrations.
- Token Format: We strongly advise against using regular expressions (regex) to identify or validate Notion Public API tokens. The token format may change over time, and relying on regex patterns could lead to false positives or negatives. Instead, treat the token as an opaque string and use it as provided.
- Best Practices: To handle Notion API tokens securely:
- Store tokens securely using appropriate encryption methods.
- Use Notion’s official SDKs or libraries when available, as they handle token management correctly.
- Validate tokens by making authenticated requests to Notion’s API rather than parsing the token itself.
Questions or Concerns?
If you have any questions or need assistance with this transition, please feel free to reach out to our support team or visit our docs.