Skip to content
Docs

Connecting a provider that exchanges an API key for a token

This guide is part of the Publicus connection catalog. Once you have the credentials, connect the service and Publicus stores them for you.

This is a generic guide: it describes the shape of a login that trades a long-lived API key for a short-lived token rather than any one provider, so where the key comes from and what the login looks like come from that provider’s own documentation.

Use it when the provider is not yet in the catalog, does not accept its API key on API calls, and instead has a login or token endpoint that takes the key and answers with a token. If the provider documents OAuth 2.0 client credentials, use an OAuth connection instead; if it accepts the key directly on every call, use the generic API key.

  1. Find the provider’s authentication documentation and copy three things from its login example: the full Token URL the key is posted to, what the key’s field is called in that request, and whether the request body is form-encoded or JSON.
  2. From the example answer, note which field holds the token and which holds the expiry, and how the expiry is written — a number of seconds (expires_in), a timestamp (2026-09-25T14:15:00+02:00), or seconds since 1970. If the answer carries no expiry, find the documented token lifetime instead.
  3. Check how API calls send the token. Authorization: Bearer <token> is the default; for anything else, set Header name and Value prefix to what the provider documents.
  4. Obtain the API key from the provider, fill the connection form with the values from steps 1–3, and paste the key.
  5. Save. The connection logs in straight away, so a wrong key or a wrong field name shows as an error on the connection with the provider’s own answer, before any flow depends on it.

The key is sent to the token URL and nowhere else. The token is kept by the connection and fetched again when it expires.

Open Connections under Credentials, choose Generic credential exchange, and pick API key exchanged for a token (any provider). Publicus asks for exactly the fields listed above and keeps them in your workspace’s secret storage.

See also: Generic credential exchange in the catalog.

This guide is maintained by Publicus and published under CC BY 4.0.