# Teamleader — CRM API: configuration

> Canonical URL: https://developers.apideck.com/apis/crm/teamleader/configuration

# How to create an OAuth app in Teamleader Focus

This guide is for the **application owner**: the team that ships an integration on Apideck. You
will register an integration in the Teamleader Focus Marketplace developer portal, add Apideck's
redirect URL and the connector's scopes, and paste the resulting Client ID and Client Secret into
the Apideck Dashboard. After that, your consumers connect their own Teamleader Focus accounts
through Apideck Vault without any further work from you.

Teamleader calls an OAuth app an **integration**.

## Before you start

- A **Teamleader Focus account**, or a free developer account created from the Marketplace
  developer portal.
- Access to your Apideck Teamleader connector settings for the unified API you use:
  [CRM](https://platform.apideck.com/configuration/crm/teamleader) or
  [Lead](https://platform.apideck.com/configuration/lead/teamleader).

## 1. Create your integration

1. Open the [Teamleader Focus Marketplace developer portal](https://marketplace.focus.teamleader.eu/eu/en/build).
2. Log in with your Teamleader Focus account, or create a free developer account.
3. Create a new integration.

Every registered integration is assigned its own `client_id` and `client_secret`. Teamleader's
[authentication documentation](https://github.com/teamleadercrm/api/blob/master/src/authentication.apib)
is the authoritative reference for how integrations and OAuth work on their side.

## 2. Basic information

Give the integration a name and description that identify _your_ product, so consumers recognise
who is asking for access to their Teamleader data when they authorize.

## 3. Redirect URL

Add Apideck's callback to the integration's list of allowed redirect URIs. It must be **exactly**:

```
https://unify.apideck.com/vault/callback
```

Teamleader only accepts redirect URIs that match one of the URIs whitelisted on the integration.
If the Apideck callback is missing (or differs, for example by a trailing slash), authorization
fails with an `invalid_request` error reading "Check the redirect_uri parameter".

## 4. Scopes

Teamleader asks you to select every scope the integration needs when you register it. Select
these four:

| Scope       | Used for                                                   |
| ----------- | ---------------------------------------------------------- |
| `contacts`  | Contacts, and leads (Teamleader leads are contact records) |
| `companies` | Companies                                                  |
| `deals`     | Opportunities (Teamleader deals)                           |
| `users`     | Users                                                      |

Notes need no extra scope. The Lead API only requests `contacts`, while the CRM API requests all
four; selecting all four lets one integration serve both.

If you customize the requested scopes on the Apideck side, make sure every scope Apideck requests
is also selected on the integration.

## 5. Copy your Client ID and Secret into Apideck

Copy the **Client ID** and **Client Secret** from the integration in the Marketplace developer
portal. Paste them into your Apideck Teamleader connector settings
([CRM](https://platform.apideck.com/configuration/crm/teamleader) or
[Lead](https://platform.apideck.com/configuration/lead/teamleader)) under
**Use your own client credentials**, and save.

Keep the Client Secret server-side: Teamleader advises never sharing it or embedding it in
client-side code. Your consumers never see or handle it.

From here Apideck runs the OAuth flow against your integration, using the authorization URL
`https://app.teamleader.eu/oauth2/authorize` and the token URL
`https://app.teamleader.eu/oauth2/access_token`. You do not need to configure these anywhere.
Apideck also handles token upkeep: access tokens expire after one hour, and each refresh returns a
new single-use refresh token, which Apideck stores and rotates automatically.

## 6. Test the integration

The same integration serves test and live accounts; what changes is the Teamleader account you
authorize through Vault (see the Sandbox row in the Overview for test account options).
Apideck's own Teamleader credentials let you try the connector before your integration exists;
with those, the Teamleader authorization screen shows Apideck as the requesting application
instead of your product.

The connector writes real records, so be deliberate about which account a test run points at.

## 7. Publishing on the Marketplace (optional)

You can use your integration privately with Apideck without ever publishing it. Listing it on the
Teamleader Focus Marketplace is an optional extra that goes through a Teamleader review: they ask
for a public cloud solution, an invite to a test account, a screen recording, and acceptance of
the Marketplace Terms. Ask your Teamleader contact for an expected timeline if you plan to list.

## What your consumers do next

With the credentials saved, connecting is self-service: consumers click **Authorize** in Vault,
sign in to Teamleader Focus and approve access. There are no settings to fill in.

## FAQ and troubleshooting

### Authorization fails with `invalid_request` ("Check the redirect_uri parameter")

The Apideck callback is not registered on the integration. Add
`https://unify.apideck.com/vault/callback` exactly as written to the integration's redirect URIs
(step 3), save, and have the consumer authorize again.

### Calls fail for one resource type after connecting

Check that the scope for that resource is selected on the integration (step 4), save, and have the consumer authorize again so the new scope is
granted.

### A consumer's connection stopped working

Token refresh is automatic, so an expired access token is not the cause on its own. Have the
consumer authorize again through Vault to issue a fresh set of tokens.

### Teamleader returns HTTP 429

The request volume is over Teamleader's rate limit for your integration on that Teamleader
account (the limit is listed in the connector Overview). Back off and retry; responses carry
`X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` headers you can use to pace
requests.


[API reference](https://developers.apideck.com/apis/crm/reference.md) · [Coverage matrix](https://developers.apideck.com/apis/crm/coverage)
