Skip to content

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”
  1. In n8n, open Credentials → New → Header Auth.
  2. Name: NativPost API.
  3. Header name: Authorization.
  4. Header value: Bearer npk_live_....

Reference this credential from every HTTP Request node instead of pasting the key inline.

  1. Add an HTTP Request node.

  2. 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:

      {
      "content_type": "text_only",
      "platforms": ["x", "linkedin"],
      "body_text": "={{$json.text}}"
      }
  3. Wire an upstream node (Airtable, Notion, Cron, whatever) into the HTTP node.

  1. Add a Webhook node. Set method POST and copy the production URL.

  2. In NativPost, subscribe:

    Terminal window
    curl -X POST https://app.nativpost.com/api/v1/webhooks \
    -H "Authorization: Bearer $NATIVPOST_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "url": "https://your-n8n.example.com/webhook/nativpost",
    "events": ["content.published", "campaign.launched"]
    }'
  3. Fire a test with POST /webhooks/{id}/test. n8n receives the sample and lets you map fields for downstream nodes.

Add a Function node right after the Webhook node with the Node.js verifier from Signature verification. Read the header from $json.headers["nativpost-signature"] and the raw body from $binary.data (enable Raw Body on the Webhook node first). Throw to abort the workflow on a bad signature.

The HTTP Request node supports multipart/form-data:

  • Body Content Type: Form-Data Multipart
  • Add a field file of type File wired to the Binary property of an upstream node (for example the Read Binary File node).

Set the same Authorization header credential.