OAuth 2.0 with PKCE: endpoints, client ID, token requests, the Bearer header, refresh rotation and revocation.
The REST and GraphQL APIs use OAuth 2.0 with your Jepto account, the same sign-in as Jepto MCP. You sign in once in a browser and get two tokens. The access token is a JWT you send on every request. The refresh token gets a new access token when it expires.
Jepto uses the authorization code grant with PKCE. The client is public, so there’s no client secret.
| Setting | Value |
|---|---|
| Authorization endpoint | https://auth.jepto.com/oauth2/authorize |
| Token endpoint | https://auth.jepto.com/oauth2/token |
| Revocation endpoint | https://auth.jepto.com/oauth2/revoke |
| Client ID | 7p119e6f9379mlho57pcuhmb6v |
| Discovery | https://oauth.jepto.com/.well-known/oauth-authorization-server |
| Grant types | authorization_code, refresh_token |
| Scopes | openid email profile |
| PKCE | Required. code_challenge_method=S256. |
| Redirect URIs | http://localhost:8765/callback (scripts on your computer) or https://oauth.pstmn.io/v1/callback (Postman) |
Open this URL in a browser. All parameters are required.
https://auth.jepto.com/oauth2/authorize ?response_type=code &client_id=7p119e6f9379mlho57pcuhmb6v &redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Fcallback &scope=openid%20email%20profile &code_challenge=<BASE64URL(SHA256(code_verifier))> &code_challenge_method=S256 &state=<random string>
After sign-in, Jepto redirects to redirect_uri?code=<code>&state=<state>. Check that state matches what you sent. The code works once and expires after a few minutes.
curl -X POST https://auth.jepto.com/oauth2/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d grant_type=authorization_code \ -d client_id=7p119e6f9379mlho57pcuhmb6v \ -d code="$CODE" \ -d redirect_uri=http://localhost:8765/callback \ -d code_verifier="$CODE_VERIFIER"
200 OK{
"access_token": "eyJraWQiOi...",
"id_token": "eyJraWQiOi...",
"refresh_token": "eyJjdHkiOi...",
"expires_in": 3600,
"token_type": "Bearer"
}| Field | Type | Description |
|---|---|---|
access_token | string (JWT) | Send this on every API request. Valid for 3,600 seconds. |
refresh_token | string | Swap for a new access token. Single use; see Refresh. |
id_token | string (JWT) | Identifies the user. Don’t send it to the API: it doesn’t carry your account and is rejected. |
expires_in | integer | Seconds until the access token expires |
token_type | string | Always Bearer |
This Python 3 script runs the whole flow with the standard library: it opens the sign-in page, catches the redirect on localhost:8765 and prints the tokens.
import base64, hashlib, http.server, json, secrets import urllib.parse, urllib.request, webbrowser AUTH = "https://auth.jepto.com/oauth2" CLIENT_ID = "7p119e6f9379mlho57pcuhmb6v" REDIRECT_URI = "http://localhost:8765/callback" verifier = secrets.token_urlsafe(64) digest = hashlib.sha256(verifier.encode()).digest() challenge = base64.urlsafe_b64encode(digest).rstrip(b"=").decode() state = secrets.token_urlsafe(16) webbrowser.open(AUTH + "/authorize?" + urllib.parse.urlencode({ "response_type": "code", "client_id": CLIENT_ID, "redirect_uri": REDIRECT_URI, "scope": "openid email profile", "code_challenge": challenge, "code_challenge_method": "S256", "state": state, })) class Callback(http.server.BaseHTTPRequestHandler): def do_GET(self): params = urllib.parse.parse_qs(urllib.parse.urlparse(self.path).query) if params.get("state") != [state]: raise SystemExit("State mismatch: start again") self.server.code = params["code"][0] self.send_response(200) self.end_headers() self.wfile.write(b"Signed in. You can close this tab.") server = http.server.HTTPServer(("localhost", 8765), Callback) server.handle_request() body = urllib.parse.urlencode({ "grant_type": "authorization_code", "client_id": CLIENT_ID, "code": server.code, "redirect_uri": REDIRECT_URI, "code_verifier": verifier, }).encode() with urllib.request.urlopen(AUTH + "/token", body) as response: print(json.dumps(json.load(response), indent=2))
https://auth.jepto.com/oauth2/authorize and Access Token URL to https://auth.jepto.com/oauth2/token.7p119e6f9379mlho57pcuhmb6v, leave Client Secret empty and set Scope to openid email profile.https://oauth.pstmn.io/v1/callback.
Send the access token in the Authorization header with the Bearer scheme on every REST and GraphQL request:
Authorization: Bearer eyJraWQiOi...
The token identifies you and your Jepto account. Every request runs as you, in that account, with your permissions: reading data needs the Admin role or read access to the client. Treat the token as opaque; its contents can change.
curl -X POST https://auth.jepto.com/oauth2/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d grant_type=refresh_token \ -d client_id=7p119e6f9379mlho57pcuhmb6v \ -d refresh_token="$JEPTO_REFRESH_TOKEN"
refresh_token, and the one you sent stops working immediately. Store the new one before you use the new access token. If two processes refresh with the same token, the second fails with invalid_grant.401.Revoking a refresh token signs that integration out. Its access tokens stay valid until they expire, at most 60 minutes later.
curl -X POST https://auth.jepto.com/oauth2/revoke \ -H "Content-Type: application/x-www-form-urlencoded" \ -d client_id=7p119e6f9379mlho57pcuhmb6v \ -d token="$JEPTO_REFRESH_TOKEN"
| Error | Cause | Fix |
|---|---|---|
redirect_mismatch on the sign-in page | The redirect_uri isn’t on the allowed list | Use one of the two redirect URIs exactly, or ask support to add yours |
invalid_grant exchanging a code | Code used twice, expired, or code_verifier doesn’t match the challenge | Start the sign-in again |
invalid_grant refreshing | Refresh token already used, revoked, or older than 30 days | Sign in again, and store each new refresh token |
401 UNAUTHENTICATED | Expired token, or the id_token was sent | Refresh, and send the access_token |
403 FORBIDDEN | The user lacks CLIENT:READ or can’t access that client | Check the user’s role and client access in Jepto |