-
Notifications
You must be signed in to change notification settings - Fork 53
API Endpoint for self hosted Postiz #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The endpoint was wrong. Community already discussed this here gitroomhq/postiz-n8n#4
@mrlopezco is attempting to deploy a commit to the Listinai Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughUpdates Public API docs: changes the self-hosted base URL from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
pages/public-api.mdx (2)
44-46
: Show self-hosted variants or define a shared BASE_URL to avoid path confusion.All endpoint examples use the hosted base (
https://api.postiz.com/public/v1/...
). With the new self-hosted base at/api
, paths differ (no/public/v1
). This can lead to copy/paste errors for self-hosted users.Consider defining a single
{BASE_URL}
near the top:
- Hosted:
https://api.postiz.com/public/v1
- Self-hosted:
https://{NEXT_PUBLIC_BACKEND_URL}/api
Then update examples to:
GET {BASE_URL}/integrations POST {BASE_URL}/upload GET {BASE_URL}/posts?startDate=...&endDate=... POST {BASE_URL}/posts DELETE {BASE_URL}/posts/:id POST {BASE_URL}/generate-video POST {BASE_URL}/video/functionOptionally, add a brief note under each block showing both concrete forms (hosted vs self-hosted).
Also applies to: 73-75, 99-100, 139-140, 236-237, 254-255, 284-285
71-71
: Typo: “from-data” → “form-data”.This is user-facing; fix to avoid confusion about multipart uploads.
-### Upload a new file (from-data) +### Upload a new file (form-data)
🧹 Nitpick comments (1)
pages/public-api.mdx (1)
26-26
: Clarify if rate limits apply to self-hosted.State whether the “30 requests per hour” limit is enforced only on the hosted API or also by default in self-hosted deployments.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
pages/public-api.mdx
(1 hunks)
🔇 Additional comments (1)
pages/public-api.mdx (1)
21-23
: Verify Authorization header scheme.Docs say
Authorization: {apiKey}
. Many APIs useAuthorization: Bearer {apiKey}
. Please confirm the exact scheme to prevent failed requests and update examples accordingly.
With each request you need to pass the API Key in the header `Authorization: {apiKey}`.<br /> | ||
If you are using the hosted version of Postiz the URL will be `https://api.postiz.com/public/v1`.<br /> | ||
If you are self-hosting Postiz the URL will be `https://{NEXT_PUBLIC_BACKEND_URL}/public/v1`.<br /> | ||
If you are self-hosting Postiz the URL will be `https://{NEXT_PUBLIC_BACKEND_URL}/api/`.<br /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Clarify self-hosted base URL (trailing slash + scheme duplication).
- Drop the trailing slash to avoid double slashes when composing paths.
- Confirm whether
NEXT_PUBLIC_BACKEND_URL
already includes the scheme. If yes, remove the hardcodedhttps://
prefix here to preventhttps://https://...
issues.
Apply this minimal edit:
-If you are self-hosting Postiz the URL will be `https://{NEXT_PUBLIC_BACKEND_URL}/api/`.<br />
+If you are self-hosting Postiz the base URL will be `https://{NEXT_PUBLIC_BACKEND_URL}/api`.<br />
+<br />
+Tip: If `NEXT_PUBLIC_BACKEND_URL` already includes the scheme (e.g., `https://postiz.example.com`), prefer `{NEXT_PUBLIC_BACKEND_URL}/api` without adding another `https://`.
🏁 Script executed:
#!/bin/bash
set -e
echo "🔍 Searching for NEXT_PUBLIC_BACKEND_URL occurrences:"
rg -n "NEXT_PUBLIC_BACKEND_URL" || true
echo
echo "📄 Listing environment example files:"
fd --hidden --max-depth 2 --type f .env* || true
Length of output: 919
🏁 Script executed:
#!/bin/bash
set -e
rg -n -C3 "NEXT_PUBLIC_BACKEND_URL" pages/configuration/reference.mdx
Length of output: 207
Clarify self-hosted base URL usage (avoid duplicate schemes and trailing slash)
Drop the trailing slash and guide users on when to include the https://
prefix:
-file: pages/public-api.mdx:24
-If you are self-hosting Postiz the URL will be `https://{NEXT_PUBLIC_BACKEND_URL}/api/`.<br />
+If you are self-hosting Postiz the base URL is `https://{NEXT_PUBLIC_BACKEND_URL}/api`.<br />
+
+Tip: if `NEXT_PUBLIC_BACKEND_URL` already includes `https://` (for example, `https://postiz.example.com`), use `{NEXT_PUBLIC_BACKEND_URL}/api` without an extra `https://`.
🤖 Prompt for AI Agents
In pages/public-api.mdx around line 24, update the example URL text to remove
the trailing slash and add guidance about the scheme: change the example to use
https://{NEXT_PUBLIC_BACKEND_URL}/api (no trailing slash) and add a short note
that users should include the scheme (https://) only if NEXT_PUBLIC_BACKEND_URL
does not already contain it to avoid duplicate schemes.
The endpoint was wrong.
Community already discussed this here
gitroomhq/postiz-n8n#4
Summary by CodeRabbit