socialpatra

n8n community node for SocialPatra: publish, schedule and manage social posts.

Package Information

Released: this month
Downloads: 0 weekly / 0 monthly
Latest Version: 0.2.0
Author: Kodetra Technologies

Documentation

n8n-nodes-socialpatra

n8n community node for SocialPatra: publish, schedule and manage social posts from a workflow. No runtime dependencies. MIT.

Install

In n8n: Settings, Community Nodes, Install, enter n8n-nodes-socialpatra.

Credentials

  1. In SocialPatra open Workspace, Settings, API keys and create a key. Grant only the scopes you use (table below). The key (sp_live_...) is shown once.
  2. In n8n create a SocialPatra API credential and paste the key. The default Base URL is https://api.socialpatra.com/api/v1/socialpatra; change it only for a staging or self-hosted API.
  3. Save. n8n tests the key against GET /auth/whoami.

A key belongs to one workspace, so the node acts on that workspace only.

Operations

Resource Operation API route Scopes
Post Create POST /posts posts:write, media:upload
Post Get GET /posts/{id} posts:read
Post Get Many GET /posts (pages with page/pageSize) posts:read
Post Delete DELETE /posts/{id} posts:delete
Media Upload POST /assets/upload (multipart field file, query mediaType) media:upload
Media Import From URL POST /assets/import-url media:upload
Media Get Many GET /assets (pages with page/pageSize, search) media:read
Media Delete DELETE /assets?key= media:delete
Connection Get Many GET /connections connections:read

Responses are unwrapped from SocialPatra's {success, data, meta} envelope: you get the data items directly.

Post: Create takes Content, Post Type (text, image, video, link, reel, story) and Connections (pick from your connected accounts, or pass platformId values from Connection: Get Many). Additional fields: Media URLs (comma-separated, public), Schedule (empty publishes now), Save as Draft, Tags, Title, URL. Carousel, thread and poll posts are not in v0.

Post: Get Many has Return All (pages of 100 until hasNext is false) or a Limit (max 100), plus filters: Status, Platform, Search, From/To Date.

Media: Upload sends the file in the Input Binary Field (default data) of the incoming item, with a Media Type (image, video, gif, audio, document), and returns { url }. Media: Import From URL takes a public URL and a Media Type and returns the same { url }. Media: Get Many lists uploads (Return All or Limit, Search); Media: Delete takes the asset key from the list. Uploading needs a role that may create posts, plus the scopes above on the API key.

Examples

  • Upload media, then post it: Read Binary File (or any node that outputs a file) with the file in binary property data, then SocialPatra Media: Upload with Media Type Image or Video, then SocialPatra Post: Create with Post Type Image or Video and Media URLs set to {{ $json.url }}. The key needs media:upload and posts:write.

  • Schedule from a sheet: Google Sheets trigger, then SocialPatra Post Create with Content from the row and Schedule from the date column.

  • Post a new blog entry: RSS trigger, then Post Create with Post Type Link, URL from the feed item.

  • Weekly report: Schedule trigger, SocialPatra Post Get Many with a From Date filter, then email the result.

Development

npm ci --ignore-scripts
npm run lint && npm test && npm run build
npm run dev   # starts a local n8n with the node loaded

The test (test/node.test.ts) pins every operation's route, body and query field names to the API contract in test/contract.ts (body and query fields are derived from the api-server openapi.snapshot.json, override with SOCIALPATRA_OPENAPI; routes and scopes are mirrored from the controllers) and fails if either side drifts. Dependencies are exact-pinned; n8n-workflow is a peer dependency.

API version

Get Many no longer looks up userId (the API derives it from the key), so the node requires an API release that includes this change (sched lane 431b5239) or later.

Discussion