---
title: "Getting the tokens"
method: POST
path: "/oauth/token"
tags: ["Oauth"]
---

# Getting the tokens

`POST /oauth/token`

After the customer has confirmed the app installation, you will need to exchange the `authorization_code` to a pair of access and refresh tokens. Using an access token, you can access the user's data through the API.

## Headers

- `Authorization` string, required

## Response `200`

Returns user Oauth2 tokens.

- object
  - `access_token` string — You need to use an `access_token` for accessing the user's data via API. You will need to [refresh the access token](https://pipedrive.readme.io/docs/marketplace-oauth-authorization#step-7-refreshing-the-tokens) if the `access_token` becomes invalid.
  - `token_type` string — The format of the token. Always "Bearer".
  - `refresh_token` string — A refresh token is needed when you refresh the access token. refresh_token will expire if it isn't used in 60 days. Each time refresh_token is used, its expiry date is reset back to 60 days.
  - `scope` string — List of scopes to which users have agreed to grant access within this `access_token`
  - `expires_in` integer — The maximum time in seconds until the `access_token` expires
  - `api_domain` string — The base URL path, including the company_domain, where the requests can be sent to

---

[API](https://skmtc.net/pipedrive/apis/pipedrive-api-v1.md) · [All operations](https://skmtc.net/pipedrive/apis/pipedrive-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pipedrive/pipedrive-api-v1/revisions/bf863a979545/schema)
