Skip to content

Authentication

Every Quiddly API request is authenticated via a bearer JWT in the Authorization header:

Authorization: Bearer <jwt>

Integrators obtain a JWT from a Quiddly service account (Flow 1). Some partner integrations instead use Auth0-issued machine tokens that Quiddly provisions (Flow 2) - you do not call Auth0 yourself.

The standard flow for server-to-server integrations.

  1. Quiddly provisions a service account for your tenant. Contact support; see Getting started. Self-service creation is on the roadmap.
  2. Mint a JWT with PUT /service-accounts/{email}/generate-token (requires GenerateTokenServiceAccount). The token is signed HS256 by Quiddly; use it directly.
  3. A token from this endpoint expires 365 days after it was generated (its exp claim). Call the endpoint again before then for a new token. Rotating the service account secret invalidates every token signed with the old secret, expired or not. Store the token like a secret. Tokens generated before expiry was introduced have no exp claim and stay valid until the secret is rotated.

The service-account secret never leaves Quiddly. Rotate it whenever needed via PUT /service-accounts/{email}/rotate-secret (right RotateSecretServiceAccount, refused with 400 Secret rotation not allowed for this account for an account that does not allow rotation), then mint a new token.

Quiddly checks the exp claim of a service-account token whenever the token has one, and answers 401 with the error code token_expired once it has passed. The token from generate-token has one, 365 days after it was generated, and GET /service-accounts/{email}, the list and the search return it as tokenExpiresAt (empty when no token with an expiry was generated since the secret was last rotated). Older tokens without it stay valid until the secret is rotated. While the service account is deactivated (PUT /service-accounts/{email}/toggle), every call with its token is refused with 403 access_denied; the token works again once the account is active. Tokens can only be generated for service accounts, never for an ordinary user. A token you got in another way can carry an exp claim. Decode the payload of the token and read exp to see when to replace it. To agree how your tokens are delivered and renewed, ask Quiddly support.

The token does not carry roles or rights. Quiddly looks up the rights of the service account’s user on every request, from the roles assigned to that user. When a new service account cannot call an endpoint, check which roles it has and add a role with the right the endpoint needs (see Rights and roles).

Test and production are separate environments, with their own service accounts and tokens (see Environments).

Some partner integrations authenticate with Auth0-issued machine-to-machine tokens that Quiddly arranges for you. You do not call Auth0 directly - Quiddly provisions the credentials and audience and sets this up with you. These tokens are RS256; their rights come from the permissions claim (Auth0 RBAC), and the scope claim is informational only and not used for authorization.

An endpoint that takes a machine token lists the permission it needs in the API reference, under Required permissions (machine-to-machine). A token without it is refused with 403 access_denied, naming the missing permission. A machine token is not bound to a client or a service provider. The endpoints of the external collection webhooks are listed there with their permissions.

There is no group token or master token that covers several clients. A service-account token is bound to the client of the service account.

To work across clients, connect the service account’s user to each client and request a token for each:

  1. Connect the service account’s user to the client with POST /client-users, body { "userId": "<service account email>", "clientId": "<client id>" } (right CreateClientUser). In the Operations Portal this is Connect user on the client. A system user cannot be connected to a client.
  2. Request a token for that client with POST /token/client/generate, body { "clientId": "<client id>" } (right GenerateClientToken). It answers 400 if the user is not connected to the client. The token it returns is short-lived: its lifetime is a setting of the environment, one hour by default.

Quiddly does not limit how many clients one user can be connected to.

The API has no general field-level filter for responses. What you can do:

  • Add ?returnResource=false to a write that supports it to get a smaller response. Creating an invoice then returns only the id, activating an invoice returns 204 with no body, and registering a direct payment returns only voucher_id. It is null unless the voucher was booked during the call: with asynchronous bookkeeping, or with bookkeeping off for the client, no voucher id comes back.
  • Add the include or exclude query parameter, a comma-separated list of top-level field names, to the endpoints that support it: GET /invoices/table/{id}, POST /invoices/table/search, GET /unplaced-payments and POST /unplaced-payments/search. With include, only those fields come back. exclude is ignored when include is present.
  • Give the integration’s user a role with only the rights it needs. Rights mainly limit which endpoints it can call. A few responses also leave parts empty without a read right. For example, POST /invoices/table/search leaves the payout part empty without ReadPayouts, and the client report part empty without ReadTransactionReports.

The error code comes back in the error_code field of the response body, next to message.

HTTPCause
401 authorization_header_missingNo Authorization header sent.
401 invalid_headerHeader is not Bearer <token>, or the token’s header cannot be read.
400 invalid_headerToken cannot be read or verified, for example an unsupported algorithm.
401 token_invalid_signatureToken signature is invalid, for example signed with the wrong secret.
401 token_expiredJWT past its exp claim. Re-issue.
401 invalid_claimsA required claim is missing, the audience or issuer does not match, or the token is not valid for this API.
403 access_deniedToken valid, but principal lacks the required right, or the user is deactivated.

The API allows cross-origin requests from the developer portal of the same tenant. The interactive reference uses fetch with credentials omitted; if you build a browser-side integration, supply the JWT manually in the Authorization header.