Authorization header:
Access tokens last a few minutes. Read how long from
expires_in in the token response, and ask for a new one when it runs out or the API answers 401.Personal API tokens
A personal API token lets your own scripts reach your account. Make one in Settings › API tokens.1
Create a token
Click Create API token, give it a name and choose how long it works: 7, 30, 60 or 90 days, a year, or until you delete it. Keep Client ID and secret as the kind.
2
Copy the client ID and secret
The secret is shown once. Store it where your script can read it, never in code you share.
3
Get an access token
Your script exchanges the client ID and secret for an access token:
4
Call the API
Send the access token as a bearer token. When it expires, get a new one the same way.
Single tokens (old system)
Some tools only accept one fixed token. For those, choose Single token (old system) as the kind: you get one token to send as the bearer token as it is. It works for a year. You can create single tokens until 1 March 2027; after that, use a client ID and secret.OAuth 2.0
For an app or service that other Plugchoice users sign in to. Email support@plugchoice.com for a client: tell us your app’s name and redirect URL, and which grant types you need. Plugchoice’s sign-in is OpenID Connect ataccounts.plugchoice.com. Most OAuth and OpenID Connect libraries set themselves up from its discovery document:
Access tokens are JWTs and last a few minutes (
expires_in). Send them to the API as they are.
Integrations made before this used
https://app.plugchoice.com/oauth/authorize and https://app.plugchoice.com/oauth/token. Those addresses keep working for now with the same client ID and secret, but are being phased out: we email you the date. New integrations use the addresses above.Authorization code flow
1
Send the user to sign in
state comes back unchanged. offline_access keeps the user signed in to your app for as long as you use the refresh token; leave it out and the sign-in ends with the user’s session.2
Exchange the code for tokens
3
Call the API
Send the
access_token as a bearer token. Store the refresh_token safely.Refreshing tokens
Before the access token expires, or when the API answers401:
offline_access stops working after a year without use, and the user signs in again.
Client credentials flow
For your own server, without a user:Device flow
For a device without a browser or keyboard, such as a display or a command-line tool. The device shows a code, and the user approves it on their phone or computer. Ask us to turn on the device flow for your client.1
Ask for a code
2
Show the code
Show the
user_code and tell the user to open the verification_uri, sign in and enter the code. Or show verification_uri_complete as a QR code: it has the code in it. Use the addresses from the answer, not fixed ones.3
Wait for the approval
Ask for the token every Until then the answer is
interval seconds until the user approves:400 with an error:Once approved, you get the same tokens as the authorization code flow.