English
English
Appearance
English
English
Appearance
Let people sign in to your app with their Repliz account and use the Public API on their behalf, with only the access they allow.
Your own Access Key and Secret Key open everything in your own Repliz account. Login with Repliz is for an app used by other Repliz users: each user sees what your app asks for, allows it, and your app gets a token for their account only. It's OAuth 2.0 with the authorization code flow and PKCE.
Your app → Repliz authorize page → User allows → Redirect with code → Token → Public API with Bearer| What | Where |
|---|---|
| Authorize page | https://repliz.com/oauth/authorize |
| Token | POST https://api.repliz.com/public/oauth/token |
| Revoke | POST https://api.repliz.com/public/oauth/revoke |
| Who signed in | GET https://api.repliz.com/public/me |
| Every other API | The same Public API endpoints, with Authorization: Bearer <access_token> |
| Token | Lasts | Format |
|---|---|---|
| Code | 5 minutes, once | Opaque |
| Access token | 1 hour | JWT, for Authorization: Bearer |
| Refresh token | 30 days after its last use | Opaque, starts with rplz_rt_, replaced on every refresh |
https, http only for localhost or 127.0.0.1, or an app scheme such as com.example.app:/callback for a mobile app.The app type can't be changed later.
Create a PKCE pair and a random state for every sign-in, keep them in the user's session, and send the user to the authorize page:
import crypto from 'node:crypto';
const codeVerifier = crypto.randomBytes(32).toString('base64url');
const codeChallenge = crypto.createHash('sha256').update(codeVerifier).digest('base64url');
const state = crypto.randomBytes(16).toString('base64url');
const url = new URL('https://repliz.com/oauth/authorize');
url.search = new URLSearchParams({
client_id: 'YOUR_CLIENT_ID',
redirect_uri: 'https://example.com/callback',
response_type: 'code',
scope: 'profile schedule:write',
state,
code_challenge: codeChallenge,
code_challenge_method: 'S256',
});
// redirect the browser to url.toString()| Parameter | Required | Description |
|---|---|---|
client_id | Yes | Client ID of your app. |
redirect_uri | Yes | One of the app's redirect URIs, exactly as registered. |
response_type | Yes | code |
scope | No | Scopes separated by spaces. profile is always added; left out, only profile is asked. |
state | No | Any value; it comes back unchanged. Use it to check the answer belongs to the sign-in you started. |
code_challenge | Yes | Base64url of the SHA-256 of your code_verifier, 43 characters. |
code_challenge_method | Yes | S256. plain isn't accepted. |
The user signs in to Repliz if needed, including the 2FA code when it's on, then sees your app's name, logo, website, who made it, and what it asks for, and picks Allow or Cancel.


An operator can sign in too, as themselves, when the main account gave them the Public API menu. They act on the accounts assigned to them.
Repliz sends the user back to your redirect_uri:
| Result | Query |
|---|---|
| Allowed | ?code=...&state=... |
| Cancelled | ?error=access_denied&error_description=...&state=... |
Check that state matches the one you kept before using the code.
When the request itself is wrong, Repliz doesn't send the user back. It shows the problem on its own page, with the reason for your developers, for example code_challenge is required (PKCE S256):
error | When |
|---|---|
invalid_request | code_challenge is missing or not 43 characters, or code_challenge_method isn't S256. |
invalid_scope | scope has a value Repliz doesn't know; the reason names it. |
unsupported_response_type | response_type isn't code. |
The page has a Back to button that returns the user to your redirect_uri with ?error=...&error_description=...&state=..., only if they click it. An unknown client_id or a redirect_uri the app didn't register shows an error with no way back to the app, so a wrong address can never receive anything.
From your server, send the code and the code_verifier to Token within 5 minutes:
curl -X POST "https://api.repliz.com/public/oauth/token" \
-u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-d grant_type=authorization_code \
-d code=CODE_FROM_REDIRECT \
-d redirect_uri=https://example.com/callback \
-d code_verifier=YOUR_CODE_VERIFIER{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6ImF0K2p3dCJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "rplz_rt_Vb1k3nQ8sXo2yZ7pL4mR9tA6cE0wF5hJ8uI2oP3qS1d",
"scope": "profile schedule:write"
}A public app sends client_id in the body and no secret.
Send the access token as a Bearer token. Start with Get Me to know who signed in:
curl "https://api.repliz.com/public/me" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"{
"id": "6879b98097fc8c8a78d1d4c1",
"type": "owner",
"name": "Azickri",
"email": "[email protected]",
"isEmailVerified": true,
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJ",
"plan": "gold",
"expiredAt": "2026-12-31T00:00:00.000Z"
}Link the Repliz user to your own user by id. Every other endpoint works the same as with Basic Auth, within the scopes the user allowed. Each endpoint page lists the scope it needs.
An access token lasts an hour. When it's about to expire, or a request answers 401 with token expired, trade the refresh token for new ones:
curl -X POST "https://api.repliz.com/public/oauth/token" \
-u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-d grant_type=refresh_token \
-d refresh_token=YOUR_REFRESH_TOKENEvery refresh returns a new refresh token and the old one stops working, so always save the new one. An old refresh token sent again more than a minute after it was replaced is treated as stolen, and Repliz disconnects your app. A refresh token unused for 30 days expires, and the user has to allow your app again.
When the user signs out of your app or disconnects Repliz, send either token to Revoke. The connection ends at once. Users can also disconnect your app themselves in Setting → Connected Apps, and deleting the app in Setting → Developer disconnects everyone.
Scopes follow the Public API menus. A request with GET needs the :read scope of its menu, any other method needs :write, and :write includes :read.
| Scope | Allows | Plan |
|---|---|---|
profile | Get Me and Get Addon. Always included. | Every plan |
account:read, account:write | Account API. Write also connects accounts with the OAuth API. | Standard+ |
comment:read, comment:write | Comment API | Standard+ |
contact:read, contact:write | Contact API | Standard+ |
knowledge:read, knowledge:write | Knowledge API | Standard+ |
addon:read, addon:write | Addon API. Write creates, edits, and deletes Pinterest boards. | Premium+ |
schedule:read, schedule:write | Schedule API | Premium+ |
chat:read, chat:write | Chat API | Gold+ |
broadcast:read, broadcast:write | Broadcast API | Premium+ |
content:read, content:write | Content API | Gold+ |
research:read | Research API | Gold+ |
report:read, report:write | Report API | Gold+ |
automation:read, automation:write | Automation API | Gold+ |
listener:read, listener:write | Comment Sync API | Gold+ |
watcher:read, watcher:write | Keyword Watch API | Gold+ |
template:read, template:write | Template API | Gold+ |
storage:read, storage:write | Storage API | Every plan |
Connecting a social account through the OAuth API needs account:write and the Gold plan. A scope never opens an API the user's plan doesn't have: those requests answer 402 as with Basic Auth.
| Status | Body | Meaning |
|---|---|---|
401 | { "code": 401, "message": "token expired" } | The access token is over an hour old. Refresh it. |
401 | { "code": 401, "message": "unauthorize" } | The token is invalid, or the user or your app revoked it. Ask the user to sign in again. |
403 | { "code": 403, "message": "insufficient scope, this api requires schedule:write" } | The user didn't allow that scope. Send them to the authorize page with it. |
402 | { "code": 402, "message": "upgrade plan to access this api" } | The user's plan doesn't include that API. |
A 401 comes with WWW-Authenticate: Bearer error="invalid_token" and a 403 with WWW-Authenticate: Bearer error="insufficient_scope", scope="...".
code_verifier and state for every sign-in and check state on the way back.id from Get Me. Don't sign someone in to an existing user of your app by email when isEmailVerified is false, as with operators, whose email the main account types in./token answers 401 invalid_client with this app is disabled, and the authorize page refuses it.