Error Response Format
All Mark2Notion API errors follow a consistent format to help you handle them programmatically.Response Types
Success Response
Validation Errors (400)
Used when request parameters are invalid or missing.Authentication Errors (401, 403)
Rate Limit Errors (429)
Server Errors (500)
Common Error Scenarios
Authentication Issues
401 - Missing API Key
401 - Missing API Key
Cause: No
x-api-key
header providedSolution: Include your API key in the request headers403 - Invalid API Key
403 - Invalid API Key
Cause: API key is invalid, expired, or deactivatedSolution:
- Check your API key in the dashboard
- Generate a new API key if needed
- Ensure your subscription is active
403 - No Active Subscription
403 - No Active Subscription
Cause: Your subscription is inactive or cancelledSolution: Reactivate your subscription in the dashboard
Usage Limits
429 - Quota Exceeded
429 - Quota Exceeded
Cause: You’ve exceeded your monthly request quotaSolution:
- Wait for your quota to reset next month
- Upgrade to a higher plan
- Monitor usage with response headers
Notion-Related Errors
Invalid Notion Token
Invalid Notion Token
Error:
"Invalid Notion token or insufficient permissions"
Causes:- Wrong token format
- Token has been revoked
- Integration doesn’t have access to the workspace
- Check your token at notion.so/my-integrations
- Ensure the integration is active
- Verify workspace permissions
Page Not Found
Page Not Found
Error:
"Page not found or access denied"
Causes:- Page ID is incorrect
- Page has been deleted
- Integration doesn’t have access to the page
- Page is in a different workspace
- Verify the page ID from the URL
- Share the page with your integration
- Check if the page exists
Content Validation
Invalid Markdown
Invalid Markdown
Error:
{"status": "fail", "data": {"markdown": "Missing or invalid markdown content"}}
Causes:- Empty markdown string
- Markdown parameter missing
- Content too large
Error Handling Best Practices
1. Check Response Status
Always check the HTTP status code and response status field:2. Implement Retry Logic
For rate limiting and transient errors:3. Monitor Usage
Track your API usage to avoid hitting limits:4. Graceful Degradation
Handle errors gracefully in your application:Getting Help
If you encounter errors not covered here:When reporting issues, include the full error response and the request that caused it (without sensitive data like API keys).