n8n
How to Integrate the MarketingBlocks API with n8n
✅ Step 1: Get Your Bearer Token
Before starting, you'll need a valid API token:
Copy the generated token that begins with
mab_...
✅ Step 2: Create a New Workflow in n8n
Open your n8n editor.
Click the “+” icon to add a new node.
Select HTTP Request as the node type.
✅ Step 3: Configure HTTP Request Node
Fill in the following details to call the MarketingBlocks API:
HTTP Method:
GET/POST/ etc. (depending on the endpoint you're calling)URL: Example:
https://app.marketingblocks.ai/api/v1/social-sparks/create-postorhttps://app.marketingblocks.ai/api/v1/social-sparks/get-channelsAuthentication:
Choose: None (since we’ll use custom headers)
Headers: Add a header with:
Key: Authorization Value: Bearer mab_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxResponse Format:
JSONRequest Body (for POST requests): Switch Body Content Type to
JSONand fill out parameters based on the endpoint.
✅ Step 4: Test the Connection
Click “Execute Node” to test the request. If everything is set up correctly, you’ll receive a response from the API.
✅ Optional: Reuse Token Across Multiple Requests
If you're building a more complex workflow:
Store your token in an Environment Variable or a Set node.
Use
{{ $json["your_token_field"] }}in theAuthorizationheader field.
✅ Rate Limiting Notice
The API is rate-limited to 100 requests per second per token.
Avoid loops or large parallel runs that exceed this limit.
📘 Example Usage: Fetching Channels
Method:
GETURL:
https://app.marketingblocks.ai/api/v1/social-sparks/get-channelsAuthorization Header:
Bearer mab_abc123xyz456...Success Response:
{
"channels": {
"current_page": 1,
"data": [
{
"channel_id": 254,
"platform": "facebook",
"account_name": "Jon Snow",
"avatar": "https://example.com/avatar.jpg"
}
],
"total": 1
},
"status": true
}Last updated