Skip to content

n8n Postiz Node: Hardcoded Nesting in CreatePost Causes 400 Errors for Instagram; HTTP Request Workaround #7

@llzzrrdd

Description

@llzzrrdd

The Postiz node (Create Post operation) enforces a nested payload structure (value.contentItem and image.imageItem) that mismatches Postiz's API schema (CreatePostDto expecting flat value and image arrays), causing 400 validation errors for Instagram (cmdt88b790003uq6y4lyk97o0) while other platforms (Facebook, LinkedIn, X) work. This leads to "Bad request - please check your parameters" errors.

Reproduction Steps

  1. Use the attached workflow JSON snippet (minimal reproduction).
  2. Run the workflow with a valid image upload.
  3. The Postiz node fails for Instagram with 400, but curl with flat payload succeeds.

Workflow Snippet (attach or paste your minimal JSON here, e.g., the HTTP Request node config).
Error Logs

  • n8n: "Bad request - please check your parameters"
  • Postiz API: {"message":["shortLink should not be null or undefined","tags must be an array"],"error":"Bad Request","statusCode":400} (from curl debugging)

Workaround
Use an HTTP Request node with this flat payload (replace expressions with your data):

{
"type": "now",
"date": "{{ new Date().toISOString().split('.')[0] + 'Z' }}",
"shortLink": false,
"tags": [],
"posts": [
{
"integration": { "id": "cmdt88b790003uq6y4lyk97o0" },
"value": [
{
"content": "{{ $json.text }} {{ $json.link }}",
"image": [
{
"id": "{{ $('Postiz (Upload File)').item.json.id }}",
"path": "{{ $('Postiz (Upload File)').item.json.path }}",
"alt": null,
"thumbnail": null,
"thumbnailTimestamp": null
}
]
}
],
"settings": {
"post_type": "post",
"collaborators": [],
"media_type": "IMAGE"
}
}
]
}

URL: https://postiz.exampleselfhosteddomain.net/api/public/v1/posts
Headers: Authorization: {{ $credentials.postizApi.apiKey }}, Content-Type: application/json

Expected Behavior
The node should support flat payloads for Postiz's API without nesting.

Environment

  • n8n version: 1.107.3 (self-hosted)
  • Postiz self-hosted: latest Docker
  • Node version: 1

Additional Context

  • Works for Facebook, LinkedIn, X.
  • Image upload succeeds (201).
  • Curl with flat payload works (201).

Let me know if you need more details or a PR for the fix!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions