Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developers.luminpdf.com/llms.txt

Use this file to discover all available pages before exploring further.

OAuth 2.0 lets your application request access to a user’s Lumin account on their behalf. The user reviews the requested permissions on a consent screen and explicitly approves or denies access. This makes OAuth 2.0 the right choice when your application acts on behalf of individual Lumin users rather than a single shared workspace. Lumin supports the authorization code flow with two client types:
Client typeUse caseClient secret requiredRefresh tokens
Public (PKCE)Mobile apps, SPAs, desktop appsNo — uses PKCE insteadNo
Private/ServerServer-side web apps, backend servicesYesYes
Public (PKCE) apps do not receive refresh tokens. When the access token expires, the user must re-authorize. If your app needs long-lived background access, create a Private/Server app instead.

Register your application

Before you can use OAuth 2.0, register your application in Lumin. You must be a Workspace Owner to do this. Each Workspace can have up to 5 integration apps.
1

Open Integration apps

Log in to Lumin and go to Settings → Developer settings → Integration apps, then click Create app.
2

Set application details

Enter an Application name and select an Application type:
  • Public Application — no client secret, uses PKCE. Choose this for mobile apps, SPAs, or desktop apps.
  • Private Application — server-based with a client secret. Choose this for backend or server-side applications.
You cannot change the application type after creation. If you need a different type, create a new application.
3

Select scopes

Choose only the scopes your application actually needs. The scopes you select appear on the user consent screen. See Scopes for the full list.
4

Configure redirect URIs

Enter one or more redirect URIs where Lumin will send users after they authorize your app.
  • Must use https:// or an app-specific scheme (e.g., myapp://callback)
  • No wildcards, IP addresses, or relative paths
  • Separate multiple URIs with commas
5

Configure consent screen

Fill in the information users will see when granting access: app logo, website URL, Privacy Policy URL, Terms of Use URL, and a contact email.
6

Save and retrieve credentials

Click Create. You will receive:
  • Client ID — required for all OAuth 2.0 flows
  • Client Secret — issued only for Private Applications
Store these credentials securely. Do not hardcode them in your source code or commit them to repositories.

Authorization code flow

Use this flow for server-side applications. The flow uses a client secret and issues refresh tokens so your server can maintain access without user re-interaction.
1

Redirect the user to the authorization endpoint

Send the user to Lumin’s authorization URL with your app’s parameters:
GET https://auth.luminpdf.com/oauth2/auth
  ?client_id=YOUR_CLIENT_ID
  &response_type=code
  &redirect_uri=YOUR_REDIRECT_URI
  &scope=openid offline_access sign:requests
  &state=RANDOM_STATE_VALUE
  &nonce=RANDOM_NONCE_VALUE
Include offline_access in the scope to receive a refresh token.After the user approves access, Lumin redirects them to your redirect_uri with an authorization code in the query string.
2

Exchange the authorization code for tokens

Make a server-to-server POST request to exchange the code for an access token and refresh token:
curl -X POST "https://auth.luminpdf.com/oauth2/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=authorization_code" \
  -d "code=YOUR_AUTHORIZATION_CODE" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET" \
  -d "redirect_uri=YOUR_REDIRECT_URI"
Lumin returns the tokens:
{
  "access_token": "eyJhbGci0i...",
  "expires_in": 3600,
  "refresh_token": "def502...",
  "token_type": "bearer",
  "scope": "openid offline_access sign:requests"
}
3

Call Lumin APIs with the access token

Pass the access token in the Authorization header as a Bearer token:
curl -X GET "https://api.luminpdf.com/v1/user/info" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json"
4

Refresh the access token

Access tokens expire after 1 hour. Use the refresh token to get a new access token without requiring the user to re-authorize:
curl -X POST "https://auth.luminpdf.com/oauth2/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=refresh_token" \
  -d "refresh_token=YOUR_REFRESH_TOKEN" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET"

Scopes

Scopes define what your application can access. Request only the scopes your app actually needs — users see the requested scopes on the consent screen.
CategoryScopeDescription
AccountopenidRetrieve basic identity details (username, email, profile picture).
Accountoffline_accessRequest a refresh token for long-lived access. Private apps only.
Accountprofile.readView basic user profile information.
Accountprofile.settingsManage user account settings.
Workspaceworkspaces.readView information about the authenticated user’s Workspace.
TemplatestemplatesView and manage templates in a Workspace.
Documentspdf:filesCreate, edit, and delete PDF files in a Workspace.
Documentspdf:files.readRetrieve PDF documents stored in a Workspace.
Signature Requestssign:requestsCreate, update, or view signature requests.
Signature Requestssign:requests.readRetrieve signature requests.
AgreementsagreementsCreate, update, or delete AgreementGen documents.
Private integration apps receive the openid and offline_access scopes by default.
You can view the scope string for an existing application by opening its Application details modal in Settings → Developer settings → Integration apps.