Skip to content

Build an OAuth app

All plansDeveloper or integrator

An OAuth app lets your product offer Connect to Onplana to its own customers. Each customer signs in to Onplana, sees your app’s name on a consent screen, picks the workspace it may act in, and your server gets a token for that one person in that one workspace. Nobody creates or pastes a personal access token.

If you are connecting your own workspace to your own script, you do not need an app: a personal access token is simpler.

Registering takes an Owner or Admin of the workspace that will own the app, signed in on the web.

  1. Open Settings, then Developer, and find the OAuth apps card.
  2. Choose New app. Give it the name your customers will see, a homepage and, if you like, a logo.
  3. Add the redirect URIs your server receives the code on, up to 10. Each must be https, or http on localhost for your development machine.
  4. Pick the scopes the app may ask for (see below).
  5. Save. Copy the client id (it starts app_) and the client secret (it starts oas_). The secret is shown once; Onplana keeps only a hash of it.

A workspace can hold 20 apps. From the same card you can edit an app, rotate its secret (the old secret stops working at the next request, tokens already issued keep working), revoke it (every token it issued stops working at once) and read its history.

Scope What a token can do
tasks Read and change tasks, and read projects, over the REST API, as the person who connected
schedule Read projects, and publish a schedule file into the workspace as a project, over the REST API, as the person who connected
mcp Use the MCP server as an agent working for that person
webhooks Create, change and delete the webhooks your app made. It never sees the workspace’s other webhooks. Webhooks need the Business plan or above

A token never does more than the person who connected can do in the app. Ask only for the scopes your integration uses: the consent screen lists them.

The authorization server is at https://mcp.onplana.com. Its metadata is at https://mcp.onplana.com/.well-known/oauth-authorization-server.

  1. Send the customer’s browser to https://mcp.onplana.com/oauth/authorize with response_type=code, your client_id, one of your registered redirect_uri values exactly as registered, the scope (space separated) and a state value.
  2. The customer signs in, reads the consent screen, which names your app and says it is not made by Onplana, and picks the workspace your app may act in.
  3. Onplana redirects to your redirect_uri with a code and your state. Check that state matches what you sent. The code is good for 60 seconds.
  4. Your server POSTs to https://mcp.onplana.com/oauth/token with grant_type=authorization_code, the code, the same redirect_uri and your client credentials, either as client_id and client_secret in the form body or as HTTP Basic.
  5. Call the API with the access_token as a Bearer token.

PKCE is allowed but not required, because your app holds a secret. If you send no code_challenge, the state parameter is required. If you send one, send the matching code_verifier at the token step.

A redirect URI must match a registered one exactly. For http on localhost, the port may differ, so a local listener on any port works.

  • A token lasts 90 days. An app gets no refresh token: when a token expires, the customer connects again through the same flow.
  • A token belongs to one person in one workspace. To act in a second workspace, the customer connects again and picks it.
  • The customer sees your app under Settings, then Agents, and can revoke it there at any time. A revoked token answers 401.
  • Your app may make 120 requests a minute to /oauth/authorize and /oauth/token, counted per client id. A refused request answers 429 with a Retry-After header. API calls with the token follow Rate limits and plan rules.
  • /oauth/token answers 401 invalid_client when the secret is missing or wrong. If you rotated the secret, use the new one.
  • A token that answers 401 with the code OAUTH_APP_SUSPENDED belongs to an app Onplana has suspended. Write to us.