Jepto
Developer Docs
Developer docs

Authentication

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.

1AuthorizeBrowser opens Jepto sign-in
2Sign inYour Jepto login
3Exchange the codePOST /oauth2/token
4Call the APIBearer access token

OAuth settings

Jepto uses the authorization code grant with PKCE. The client is public, so there’s no client secret.

SettingValue
Authorization endpointhttps://auth.jepto.com/oauth2/authorize
Token endpointhttps://auth.jepto.com/oauth2/token
Revocation endpointhttps://auth.jepto.com/oauth2/revoke
Client ID7p119e6f9379mlho57pcuhmb6v
Discoveryhttps://oauth.jepto.com/.well-known/oauth-authorization-server
Grant typesauthorization_code, refresh_token
Scopesopenid email profile
PKCERequired. code_challenge_method=S256.
Redirect URIshttp://localhost:8765/callback (scripts on your computer) or https://oauth.pstmn.io/v1/callback (Postman)
Redirect URIs must match exactly, character for character. To use another one, such as a hosted app’s callback, ask Jepto support to add it.

‍

Authorization request

Open this URL in a browser. All parameters are required.

GET
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.

Token request

Request
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"
Response200 OK
{
  "access_token": "eyJraWQiOi...",
  "id_token": "eyJraWQiOi...",
  "refresh_token": "eyJjdHkiOi...",
  "expires_in": 3600,
  "token_type": "Bearer"
}
FieldTypeDescription
access_tokenstring (JWT)Send this on every API request. Valid for 3,600 seconds.
refresh_tokenstringSwap for a new access token. Single use; see Refresh.
id_tokenstring (JWT)Identifies the user. Don’t send it to the API: it doesn’t carry your account and is rejected.
expires_inintegerSeconds until the access token expires
token_typestringAlways Bearer

‍

Get a token with a script

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.

get_token.py
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))

Get a token with Postman

  1. Open Authorization on a request or collection and choose OAuth 2.0.
  2. Set Grant type to Authorization Code (With PKCE) and Code Challenge Method to SHA-256.
  3. Set Auth URL to https://auth.jepto.com/oauth2/authorize and Access Token URL to https://auth.jepto.com/oauth2/token.
  4. Set Client ID to 7p119e6f9379mlho57pcuhmb6v, leave Client Secret empty and set Scope to openid email profile.
  5. Tick Authorize using browser. Postman uses https://oauth.pstmn.io/v1/callback.
  6. Click Get New Access Token, sign in to Jepto, then click Use Token.

‍

Send the token

Send the access token in the Authorization header with the Bearer scheme on every REST and GraphQL request:

Header
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.

‍

Refresh the token

Request
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 tokens rotate. The response has a new 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.
  • Refresh tokens last 30 days. After that, sign in again.
  • Refresh ahead of expiry. For a scheduled job, refresh at the start of each run rather than waiting for a 401.

Revoke a token

Revoking a refresh token signs that integration out. Its access tokens stay valid until they expire, at most 60 minutes later.

Request
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"

Access and security

  • A token acts as its user: the same clients and permissions as in the Jepto app. A guest user’s token only sees the clients they’ve been given.
  • Removing a user from Jepto stops their refresh tokens working. Access tokens already issued last until they expire.
  • Store refresh tokens in a secrets manager or environment variable, never in code or a repository.
  • Use one sign-in per integration, so you can revoke one without breaking the others.

‍

Troubleshooting

ErrorCauseFix
redirect_mismatch on the sign-in pageThe redirect_uri isn’t on the allowed listUse one of the two redirect URIs exactly, or ask support to add yours
invalid_grant exchanging a codeCode used twice, expired, or code_verifier doesn’t match the challengeStart the sign-in again
invalid_grant refreshingRefresh token already used, revoked, or older than 30 daysSign in again, and store each new refresh token
401 UNAUTHENTICATEDExpired token, or the id_token was sentRefresh, and send the access_token
403 FORBIDDENThe user lacks CLIENT:READ or can’t access that clientCheck the user’s role and client access in Jepto