-
Notifications
You must be signed in to change notification settings - Fork 11
Description
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
- Use the attached workflow JSON snippet (minimal reproduction).
- Run the workflow with a valid image upload.
- 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!