Build an OAuth app
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.
Register the app
Section titled “Register the app”Registering takes an Owner or Admin of the workspace that will own the app, signed in on the web.
- Open Settings, then Developer, and find the OAuth apps card.
- Choose New app. Give it the name your customers will see, a homepage and, if you like, a logo.
- Add the redirect URIs your server receives the code on, up to 10.
Each must be
https, orhttponlocalhostfor your development machine. - Pick the scopes the app may ask for (see below).
- Save. Copy the client id (it starts
app_) and the client secret (it startsoas_). 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.
Scopes
Section titled “Scopes”| 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 sign-in flow
Section titled “The sign-in flow”The authorization server is at https://mcp.onplana.com. Its metadata is at
https://mcp.onplana.com/.well-known/oauth-authorization-server.
- Send the customer’s browser to
https://mcp.onplana.com/oauth/authorizewithresponse_type=code, yourclient_id, one of your registeredredirect_urivalues exactly as registered, thescope(space separated) and astatevalue. - 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.
- Onplana redirects to your
redirect_uriwith acodeand yourstate. Check thatstatematches what you sent. The code is good for 60 seconds. - Your server POSTs to
https://mcp.onplana.com/oauth/tokenwithgrant_type=authorization_code, thecode, the sameredirect_uriand your client credentials, either asclient_idandclient_secretin the form body or as HTTP Basic. - Call the API with the
access_tokenas 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.
Tokens
Section titled “Tokens”- 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.
Limits and errors
Section titled “Limits and errors”- Your app may make 120 requests a minute to
/oauth/authorizeand/oauth/token, counted per client id. A refused request answers 429 with aRetry-Afterheader. API calls with the token follow Rate limits and plan rules. /oauth/tokenanswers 401invalid_clientwhen 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_SUSPENDEDbelongs to an app Onplana has suspended. Write to us.
Was this helpful?
Thanks for your feedback!