n8n integration
n8n has no dedicated NativPost node, but the generic HTTP Request node covers every endpoint. This guide sets up both directions.
One-time: store the API key as a credential
Section titled “One-time: store the API key as a credential”- In n8n, open Credentials → New → Header Auth.
- Name:
NativPost API. - Header name:
Authorization. - Header value:
Bearer np_live_....
Keys start with np_live_. Reference this credential from every HTTP Request node instead of pasting the key inline.
Outbound: create content from a workflow
Section titled “Outbound: create content from a workflow”-
Add an HTTP Request node.
-
Configure:
-
Method:
POST -
URL:
https://app.nativpost.com/api/v1/content -
Authentication: Header Auth,
NativPost API -
Send Body: JSON, using expressions to pull fields from earlier nodes:
{"caption": "={{$json.text}}","content_type": "text_only","target_platforms": ["twitter", "linkedin"]}
-
-
Wire an upstream node (Airtable, Notion, Schedule Trigger, whatever) into the HTTP node.
Field names to get right: the copy goes in caption, destinations go in target_platforms, and X’s platform id is twitter. caption is the only required field; content_type defaults to single_image, so set it explicitly for text posts.
To attach media, add "media_urls": ["https://..."] — absolute URLs, in order, max 20.
Scheduling and publishing
Section titled “Scheduling and publishing”Add a second HTTP Request node with method PATCH against https://app.nativpost.com/api/v1/content/{{$json.id}}:
{ "status": "scheduled", "scheduled_for": "={{$json.when}}"}Or POST to https://app.nativpost.com/api/v1/content/{{$json.id}}/publish with an empty body to queue it for the next cron run. That returns 202 and publish_queued: true — it does not publish inline, so do not branch on per-platform results from this response.
Inbound: receive events
Section titled “Inbound: receive events”-
Add a Webhook node. Set method
POSTand copy the production URL. -
In the NativPost dashboard, go to Settings → Webhooks and add an endpoint pointed at that URL, subscribed to the events you want.
The API cannot create webhook endpoints.
GET /api/v1/webhooksis read-only — useful to confirm registration, not to perform it:Terminal window curl -sS https://app.nativpost.com/api/v1/webhooks \-H "Authorization: Bearer $NATIVPOST_API_KEY" -
There is no test-fire endpoint. To get a sample into n8n so you can map fields, create a throwaway draft over the API —
content.createdfires immediately.
Each delivery is attempted once with a 10-second timeout, with no retries, and the endpoint is auto-disabled after 20 consecutive failures. Keep the Webhook node’s response immediate and push slow work downstream.
Signature verification
Section titled “Signature verification”Add a Code node right after the Webhook node with the Node.js verifier from Signature verification. Read the header from $json.headers["nativpost-signature"] — n8n lowercases incoming header names — and the raw body from $binary.data (enable Raw Body on the Webhook node first). Throw to abort the workflow on a bad signature.
$json.headers["nativpost-event"] carries the event name if you want to route with a Switch node before verifying, and nativpost-delivery-id uniquely identifies the attempt.
There is no upload endpoint on /api/v1, so the HTTP Request node’s multipart mode has nothing to target. Two options:
- Upload in the NativPost dashboard under Content → Media, then read URLs back with
GET /api/v1/media-libraryand feed them intomedia_urls. - Host the file yourself and pass your own public URL.
Duplicate protection
Section titled “Duplicate protection”The API applies no rate limit and supports no idempotency key. If an n8n workflow retries a failed HTTP Request node, the retry creates a second content object. Use n8n’s error workflow rather than blind node-level retries on the create step.