Authentication
The first steps for integrating with Tesouro are to:- Activate your developer account
- Receive your API access key credentials
- Create and authenticate your first JSON Web Token (JWT) to Tesouro.
Access your organization’s API access key credentials
Your organization’s API access key and secret are created by Tesouro and shared with you. To receive access:- Have your designated team lead submit your access request here (external site managed by Tesouro)
- Tesouro will email you an API access key and secret that will require passwordless authentication via email address.
Create and authenticate your JWT
Create a JWT, then add it to the header of your call to query the Tesouro Sandbox environmentAuthentication Request
Authentication Request
Example Request
Example Response
For production, use
https://api.tesouro.com/graphql instead of https://api.sandbox.tesouro.com/graphql with production credentialsToken Exchange for User Impersonation
For seamless widget and API experiences, Tesouro supports OAuth 2.0 Token Exchange (RFC 8693). This allows your application to impersonate users on the Tesouro platform by exchanging a user JWT for an access token.Token Exchange Request
Token Exchange Response
Subject Token Requirements: Your JWT must include both the user’s unique identifier in the
sub claim and the user’s email address in the email claim. The returned access token contains RFC 8693 delegation claims indicating it’s an impersonated token.Security: Users can only be impersonated within their assigned application context. Cross-application impersonation is prevented for security.