Authentication
Every Publer API request must include a valid API key. This guide shows you how to obtain, use, and manage your keys securely.
Obtaining an API Key
Sign in to your Publer account (Business plan).
Navigate to Settings → Access & Login → API Keys.
Click Create API Key.
Enter a descriptive name for your key.
Select only the scopes your integration needs (e.g.,
posts,media,accounts).Click Create.
Copy and securely store the key — you won’t see it again.
Using Your API Key
Include your key in the Authorization header for every request. Also provide your workspace ID:
Authorization: Bearer-API YOUR_API_KEY
Publer-Workspace-Id: YOUR_WORKSPACE_ID
Content-Type: application/jsonExample (list posts):
curl -X GET https://app.publer.com/api/v1/posts \
-H "Authorization: Bearer-API YOUR_API_KEY" \
-H "Publer-Workspace-Id: 5f8d7a62c9e77e001f36e3a1"API Key Scopes
When creating an API key, you must select specific permission scopes based on your integration needs:
Scope
Description
Example Endpoints
workspaces
Retrieve user's workspaces
/workspaces
accounts
Retrieve user's accounts of selected workspace
/accounts
posts
Manage user's posts
/posts
media
Upload and list media assets
/media
Common Authentication Errors
401 Unauthorized • Missing or invalid
Authorizationheader • Key revoked or expired403 Forbidden • Insufficient scopes for the endpoint • Missing
Publer-Workspace-Idheader
Always inspect the JSON error response for message and code.
Security Best Practices
Environment Variables Store your key outside code—e.g., in a
.envfile:PUBLER_API_KEY=your_api_key_hereSecrets Management Use a vault (AWS Secrets Manager, Azure Key Vault, HashiCorp Vault).
Key Rotation Rotate keys every 90–180 days, or after team changes/incidents.
Least Privilege Create separate keys for different use cases.
Safe Logging Never log full keys; mask all but the last 4 characters:
console.log(`Using key ***${apiKey.slice(-4)}`);Always HTTPS Never send keys over plain HTTP.
Troubleshooting
If you continue to see authentication errors:
Confirm your key is active and not expired.
Verify you have the correct header names and values.
Double-check that your key has the required scopes.
Contact [email protected] for assistance.
Related Documentation
Last updated
Was this helpful?

