Skip to content

Implementation

Register an OAuth app, run the Authorization Code flow, and manage credentials in the OpenQuok dashboard.

4 min read

Connect your agent today

Draft from chat, review in your calendar, and publish only what you approve.

Start for $0

Register your OAuth app

In the OpenQuok dashboard, go to:

  • AccountSettingsDevelopersApps

Create an OAuth application and provide:

  • App name — displayed to users on the consent screen
  • Description (optional)
  • Profile picture (optional)
  • Redirect URL — where OpenQuok sends users after they approve/deny access

After creation you’ll receive:

  • Client ID — public identifier (prefix oqc_...)
  • Client secret — secret key for token exchange (prefix oqs_...)

Redirect users to authorize

Redirect the user to:

OPENQUOK_FRONTEND_URL/oauth/authorize?client_id=CLIENT_ID&response_type=code&state=STATE
ParameterRequiredDescription
client_idYesYour app’s Client ID (starts with oqc_)
response_typeYesMust be code
stateNoA random string to prevent CSRF attacks. Recommended.
  • OPENQUOK_FRONTEND_URL is the OpenQuok web origin (for example https://www.openquok.com)

Example:

https://www.openquok.com/oauth/authorize?client_id=oqc_your_client_id&response_type=code&state=random123
Example valueWhat it is
https://www.openquok.comOpenQuok frontend origin (your OPENQUOK_FRONTEND_URL)
oqc_your_client_idYour app’s Client ID
codeThe only supported response_type
random123Example state value

The user will see a consent screen showing your app’s name and description. They can choose Authorize or Deny.

Handle the callback

After the user approves, OpenQuok redirects to your Redirect URL.

Approved:

https://yourapp.com/callback?code=abc123&state=random123
Query paramRequiredDescription
codeYesAuthorization code (single-use; expires in 10 minutes)
stateNoThe same state you sent in the authorize step

Denied:

https://yourapp.com/callback?error=access_denied&state=random123
Query paramRequiredDescription
errorYesaccess_denied when the user denies the request
stateNoThe same state you sent in the authorize step

Verify the state value matches what you sent.

Exchange code for a token

Make a server-side request to exchange the authorization code for an access token.

curl -X POST https://api.openquok.com/api/v1/oauth/token 
  -H "Content-Type: application/json" 
  -d '{
    "grant_type": "authorization_code",
    "code": "abc123",
    "client_id": "oqc_your_client_id",
    "client_secret": "oqs_your_client_secret"
  }'
FieldRequiredDescription
grant_typeYesMust be authorization_code
codeYesThe authorization code from the callback
client_idYesYour app’s Client ID
client_secretYesYour app’s Client Secret

The redirect URL is validated when the user approves on the consent screen (stored on your OAuth app). Do not send redirect_uri in this request.

Response:

{
  "organizationId": "org_abc123",
  "access_token": "opo_your_access_token",
  "token_type": "bearer"
}
FieldDescription
organizationIdThe workspace (organization) that was authorized
access_tokenThe OAuth access token to use for API calls
token_typeAlways bearer

Make API calls

Use the returned access_token as a Bearer token in the Authorization header:

curl -H "Authorization: Bearer opo_your_access_token" 
  https://api.openquok.com/api/v1/public/integrations
PartRequiredDescription
Authorization headerYesSet to your OAuth access_token
URLYesAny public API endpoint under /api/v1/public/*

Managing your app

Rotate client secret

If your client secret is compromised, go to DevelopersApps and click Rotate secret.

This invalidates the old secret immediately — any token exchange requests using the old secret will fail.

Delete your app

Deleting your OAuth app will:

  • Revoke all access tokens issued to users
  • Remove the app from all users’ Approved Apps list
  • This action cannot be undone
Search documentation
Find a docs page
Discord Support