API Credentials vs OAuth 2.0: Client Credentials or Consent?

Both are OAuth 2.0 in Paprel. Use client credentials when you own both sides; use authorization code and consent when a customer delegates access.

Paprel Engineering Team
7 min read
A service key and a consent card illustrate two distinct paths to an accounting ledger

"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 credentialsAuthorization code + consent
Who grants accessYou, for systems you runA customer, for an app they choose
How it startsCreate an API credential or App Connect client in the workspaceThe app registers, the user approves a consent screen
Paprel endpointsPOST /v1/app-connect/oauth/token with grant_type: client_credentialsPOST /v1/app-connect/oauth/register (dynamic client registration), then /oauth/authorize
Typical useYour backend, a BFF for Embedded UI, jobs and syncsMCP 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:

Shell
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.

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:

  1. The client discovers the authorization server at /.well-known/oauth-authorization-server.
  2. It registers itself with POST /v1/app-connect/oauth/register, sending redirect_uris and, optionally, a client_name. This is RFC 7591 dynamic client registration. Permissions are optional at registration; the effective permissions are granted during consent.
  3. It sends the user to /oauth/authorize with client_id, redirect_uri, scope, state and a PKCE code_challenge.
  4. 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:action permissions, 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.
Create a sandbox credential and exchange your first token →

Start in the sandbox, then review how Paprel handles security and scope design.

Posted by: Paprel Engineering Team · Engineering
Posted on: (Updated: October 29, 2026)
Evaluate Paprel

Build in sandbox, launch with a production trial

Use sandbox for developer testing with no billing. When you are ready for real workflows, start production on a monthly plan with a 14-day free trial.

API-First Delivery
Audit-Ready Controls
Sandbox And Guided Rollout