Integration recipe
Publish to pixPLace from n8n: HTTP Request nodes
Two HTTP Request nodes in n8n upload an image by URL and publish a post; Retry On Fail is safe because of Idempotency-Key.
Who it is for
Self-hosters and automation builders who run workflows in n8n.
What it automates
Publish a post for every item the workflow produces: upload the image by URL, then create the post.
Steps
- Create one Header Auth credential: Name Authorization, Value Bearer followed by your ppk_live_ key. Use it in both nodes.
- Add the node HTTP Request named Upload from URL: method POST, the upload address, a JSON body from the expression below.
- Add the node HTTP Request named Create post right after it. Its body takes publicUrl from the first node. Name the node that holds your data Source item.
- Turn on Retry On Fail (3 tries, 5000 ms) and send an Idempotency-Key built from the execution and the item index. A retry then cannot create a second post.
- When you create the key, tick the `publish` scope. A key without it gets 403 insufficient_scope on these calls.
Examples
Placeholders: ppk_live_XXXXXXXX is your key. The ids and the image address are samples. The API address is always https://pixplace.space/api/v1.
Node 1: Upload from URL
Method: POST
URL: https://pixplace.space/api/v1/uploads/from-url
Authentication: Generic Credential Type, Header Auth (Authorization: Bearer <key>)
Send Headers: Idempotency-Key = upload-{{ $execution.id }}-{{ $itemIndex }}
Send Body: JSON, Using JSON (expression):
{{ JSON.stringify({ url: $json.imageUrl }) }}
Settings: Retry On Fail, Max Tries 3, Wait Between Tries 5000 msNode 2: Create post
Method: POST
URL: https://pixplace.space/api/v1/posts
Authentication: the same Header Auth credential (Authorization: Bearer <key>)
Send Headers: Idempotency-Key = post-{{ $execution.id }}-{{ $itemIndex }}
Send Body: JSON, Using JSON (expression):
{{ JSON.stringify({
title: $('Source item').item.json.title,
attachments: [{ url: $json.data.publicUrl, type: $json.data.type }],
description: $('Source item').item.json.description
}) }}
Settings: Retry On Fail, Max Tries 3, Wait Between Tries 5000 msCommon errors
| Status | Cause | What to do |
|---|---|---|
| 400 | The JSON expression produced an empty title or an empty publicUrl, because a node name in the expression does not match your workflow. | Rename the node that holds your data to Source item or edit the expression. Execute node 1 once and check that data.publicUrl exists. |
| 401 | The API key is missing, malformed, revoked or sent in the wrong header. | In the Header Auth credential the Name must be exactly Authorization and the Value must start with Bearer and a space. The header must read Authorization: Bearer followed by your ppk_live_ key. Check the key in Settings → Developer. |
| 403 | The key lacks a scope the call needs: the answer is 403 with error.code insufficient_scope and the missing scope in error.required. | Create a new key in Settings → Developer with the `publish` scope ticked and use it instead; repeating the call with the same key fails the same way. |
| 429 | A per-minute or per-day limit was reached. The Retry-After header and the retryAfter field of the body say how many seconds to wait. | Wait that long and repeat with the SAME Idempotency-Key. Turn on Include Response Headers and Status and Never Error in the node options, then wait for the retry-after header before you go on. |
| 502 | The server could not download the source URL: it answered 4xx or 5xx, the host does not resolve or the response was compressed. | Open the source URL in a private browser window. It must be public and answer 200 without a login. |
The full list of statuses, the retry rules and the limits are in Errors and retries.