Skip to main content

Introduction

API credentials are the recommended way to connect your own systems (ERPs, BI tools, automation platforms, internal scripts) to a Talqui workspace. Each credential belongs to one workspace (tenant): it is not tied to a person, so it keeps working when the operator who created it leaves the team. A credential is a client ID and a client secret. Your integration exchanges them for an access token that lasts 1 hour and sends that token on every API request. This is the standard OAuth 2.0 Client Credentials flow.
Credentials have full access to the data of their workspace. Treat the client secret like a password and keep it on your server, never in a browser or mobile app.

Creating a credential

Only workspace owners and managers can manage credentials.
  1. In the Talqui web app, open Settings → API credentials (Credenciais de API).
  2. Click New credential, give it a name (for example, the system it connects) and, optionally, an expiration date.
  3. Copy the client ID and the client secret right away. The secret is shown only once: if you lose it, rotate it to get a new one.

Getting an access token

Send the client ID and secret with HTTP Basic authentication to the token endpoint:
The answer carries the token and its lifetime in seconds:
There is no refresh token: when the access token is about to expire, ask for a new one the same way. Reuse a token while it is valid instead of requesting one per API call.

Calling the API

Send the access token as a Bearer token. Requests are scoped to the credential’s workspace: use its tenant ID in the URL.
A token used on another workspace is refused with 403.

What a credential can call

An API credential reaches the endpoints below. Any other endpoint answers 403, including the ones that act as a person (operator presence, shortcuts, notifications), the workspace settings, analytics and plugins, and the legacy campaign endpoints of https://api.talqui.chat. Services API (https://services-api.talqui.chat, every path starts with /v1/tenants/{tenantID}): The request and response of each one are in the Services API reference. Campaigns created by a credential are attributed to it. To send a campaign to one contact, see Single Sends. REST API (https://api.talqui.chat): only POST /tenants/{tenantID}/sessions, to start a session.

Managing credentials

In Settings → API credentials you can see who created each credential, its expiration and when it last issued a token, and:
  • Revoke it: new tokens are refused at once and tokens already issued stop working within a few minutes. Use this if a secret leaks.
  • Reactivate a revoked credential.
  • Rotate the secret: the old secret stops working at once; tokens already issued stay valid until they expire (up to 1 hour).
  • Delete a revoked credential.
An expired credential stops issuing tokens. Create a new one to replace it.

Other authentication methods

Plugins keep authenticating with their own credentials (Plugin and PluginConnection), described in Authentication. Integrations already using a plugin connection credential keep working; API credentials are the path for new integrations.