"API credentials vs OAuth 2.0" sounds like a choice between two technologies. In Paprel it isn't: both paths are OAuth 2.0. The real choice is which grant fits who is granting access.
- Client credentials when you own both sides: your backend calling Paprel for your own company or your platform's tenants.
- Authorization code with consent when a customer delegates access to someone else's app, such as an AI client connecting to their books.
Pick by asking one question: who is granting access? The rest of this post shows what each path looks like on the wire.
The Short Version
| Client credentials | Authorization code + consent | |
|---|---|---|
| Who grants access | You, for systems you run | A customer, for an app they choose |
| How it starts | Create an API credential or App Connect client in the workspace | The app registers, the user approves a consent screen |
| Paprel endpoints | POST /v1/app-connect/oauth/token with grant_type: client_credentials | POST /v1/app-connect/oauth/register (dynamic client registration), then /oauth/authorize |
| Typical use | Your backend, a BFF for Embedded UI, jobs and syncs | MCP clients and third-party apps acting for a customer |
Client Credentials: When You Own Both Sides
Your workspace issues a client_id and a client_secret. Those identify your application, not a user. Your server exchanges them for a short-lived access token, then sends the token on every call.
In Paprel, API credentials and App Connect clients use the same flow and the same headers. They differ in intended use, not on the wire. API credentials suit a server-owned integration for your own company; App Connect clients suit Embedded UI and partner-hosted experiences. Both exchange at the same endpoint:
export BASE="https://api-sandbox.paprel.com"
export PARTNER_DOMAIN="sandbox.paprel.com"
export ACCESS_TOKEN="$(curl --fail --silent --show-error \
-X POST "$BASE/v1/app-connect/oauth/token" \
-H "content-type: application/json" \
-H "x-partner-domain: $PARTNER_DOMAIN" \
--data "$(jq -n \
--arg client_id "$CLIENT_ID" \
--arg client_secret "$CLIENT_SECRET" \
'{grant_type:"client_credentials", client_id:$client_id, client_secret:$client_secret}')" \
| jq -r '.access_token')"
curl "$BASE/v1/accounting/journals" \
-H "authorization: Bearer $ACCESS_TOKEN" \
-H "x-partner-domain: $PARTNER_DOMAIN"
The response is a standard RFC 6749 token response, so access_token and expires_in sit at the top level. Tokens expire after expires_in seconds, one hour by default. Cache the token until shortly before expiry, then exchange again. Don't mint one per request. The full walkthrough, including failure modes like 400 Missing required x-partner-domain header, is in the authentication guide.

API credentials in the Paprel workspace. Each one is managed and revocable. Create one per application and environment.
Where Client Credentials Break Down
Client credentials go wrong when a team stretches them into a delegation problem:
- asking customers to paste an admin credential into a third-party app
- reusing one credential across customers or environments
- giving a partner broader permissions than its job needs
- having no way to revoke one integration without rotating a shared secret
At that point the credential format isn't the problem. The access model no longer reflects who should be granting permission.
Authorization Code And Consent: When A Customer Delegates
When a customer connects an app they chose, they should approve it themselves instead of handing over a secret. That is what the authorization code flow is for: the app sends the user to an authorization endpoint, the user sees what the app is asking for, and the app receives a token bound to that approval.
Paprel's hosted MCP server uses this path for AI clients:
- The client discovers the authorization server at
/.well-known/oauth-authorization-server. - It registers itself with
POST /v1/app-connect/oauth/register, sendingredirect_urisand, optionally, aclient_name. This is RFC 7591 dynamic client registration. Permissions are optional at registration; the effective permissions are granted during consent. - It sends the user to
/oauth/authorizewithclient_id,redirect_uri,scope,stateand a PKCEcode_challenge. - The user approves the requested access on the consent screen for their company.
The custom agent guide covers the MCP connection values and how to keep the resulting token least-privilege.

Registering an OAuth application in the workspace. The registration names the app and its redirect URIs; what it may do is decided by the permissions it is granted.
Why This Matters More In Multi-Tenant Accounting
Once a platform hosts many companies, a shared secret becomes a liability. For every connection you should be able to answer:
- which company authorized it
- which permissions it holds
- how to revoke it without affecting anyone else
- what it did, after the fact
Accounting raises the stakes. A token that reaches invoices, payments or journals is part of your financial control model, not just a developer convenience. Least-privilege design for those permissions is covered in OAuth Scopes for Accounting APIs.

An App Connect client's detail view: one known application, its credentials and its company.
A Simple Decision Framework
Use client credentials when:
- your backend or a job you run calls Paprel
- you're minting tokens for Embedded UI through a BFF
- no end user needs to approve anything
Use authorization code and consent when:
- a customer connects an app they chose, such as an AI client
- the app's operator is not you
- the customer should be able to see and revoke what they approved
Use both when your platform runs its own integrations and also lets customers connect outside apps. That is the normal case for an embedded accounting platform.
Where Paprel Fits
- Tenant-scoped tokens. A token reaches one company, and only the routes its grants allow.
- Per-route grants. Every route in the OpenAPI spec declares its required
resource:actionpermissions, so you can grant an integration exactly the tier it needs. - The secret never reaches the browser. For Embedded UI, a small backend-for-frontend holds the
client_secret, performs the exchange and returns only a short-lived token to the page. - Delegated consent for agents. MCP clients connect through registration and consent instead of a pasted credential.
Read Next In This Series
- OAuth Scopes for Accounting APIs: Beyond Read and Write: designing the grants a token carries.
- Paprel Webhooks: Signed, Retried, At-Least-Once Accounting Events: the event side of an integration.
- Paprel MCP for AI Agents and Accounting Workflows: delegated access for AI clients.
Start in the sandbox, then review how Paprel handles security and scope design.
