> ## Documentation Index
> Fetch the complete documentation index at: https://developers.wrike.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Oauth 2.0 Authorization

Wrike API uses the OAuth 2.0 protocol for authorization. The OAuth 2.0 Authorization Framework protocol is described in <Anchor label="http://tools.ietf.org/html/rfc6749" target="_blank" href="http://tools.ietf.org/html/rfc6749">[http://tools.ietf.org/html/rfc6749](http://tools.ietf.org/html/rfc6749)</Anchor>. OAuth standard defines four flows for different use cases: authorization code, implicit, resource owner password credentials, and client credentials. At the moment, we support only authorization code flow.

<Callout icon="📘" theme="info">
  This documentation contains a brief description of the OAuth 2.0 authorization process. For details, please see <Anchor label="[RFC6749, 4.1.]" target="_blank" href="https://tools.ietf.org/html/rfc6749#section-4.1">\[RFC6749, 4.1.]</Anchor>.
</Callout>

### Initial Setup

Before you get started with OAuth 2.0 authorization, you'll need to register and properly set up the Wrike API application. Each application is assigned a unique Client ID and Client Secret which will be used in the OAuth flow. You can find the client credentials of your application and manage other options on <Anchor label="App Console" target="_blank" href="https://www.wrike.com/appconsole.htm?#/api">App Console</Anchor>. Screenshot below demonstrates the configuration section of any application.

<Image align="center" alt="Wrike Application creation flow" border={true} width="50% " src="https://files.readme.io/da92faa39b86060c626caf716dbe0c4243a3093cc38842c13122863d0378567b-Screenshot_2026-04-01_at_9.56.08_PM.png" className="border" />

<br />

<Callout icon="📘" theme="info">
  Please note the **Client ID** and **Client secret** fields as you will need them on the next steps.
</Callout>

***

<span class="wrike-section-label">Authorization flow</span>

## OAuth 2.0 authorization flow

<Image align="center" border={true} src="https://files.readme.io/04a5bf83dca8be5ad46c54dd043cbb7082cd7ebc87b1f09ef65d10fa9af6df43-image-2.png" className="border" />

<br />

### 1. Requesting authorization code <Anchor label="[RFC6749, 4.1.1.]" target="_blank" href="https://tools.ietf.org/html/rfc6749#section-4.1.1">\[RFC6749, 4.1.1.]</Anchor>

To start the authorization process, the user should click on the link in your application that will direct him to the following URL:

```text
https://login.wrike.com/oauth2/authorize/v4?client_id=<client_id>&response_type=<code>
```

<Callout icon="📘" theme="info">
  Please note `client_id` parameter above - it should exactly match **Client ID** field you get from <Anchor label="App Console" target="_blank" href="https://www.wrike.com/appconsole.htm?#/api">App Console</Anchor> on the previous step
</Callout>

The authorize URL can also contain the optional parameters. See details about request parameters in the table below:

| PARAMETER       | REQUIRED | DESCRIPTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `client_id`     | Required | The client\_id you obtained in the Initial Setup.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `response_type` | Required | Whether the endpoint returns an authorization code. For web applications, a value of `code` should be used.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `redirect_uri`  | Optional | URI where the response will be redirected. We assume that you have a working web server with a public address that can correctly handle Wrike requests. Redirect URI should comply with OAuth2 standard requirements and utilize HTTPS protocol. Use `https://localhost` for local development. This parameter is required if you have more than one callback URL specified in the API application.                                                                                                                            |
| `state`         | Optional | An arbitrary string that will be included in the response to your application at the end of OAuth flow. This parameter is intended to preserve some state object set by the client in the authorization request, and make it available to the client in the response. The main purpose of this is preventing [Cross Site Request Forgery (CSRF)](https://en.wikipedia.org/wiki/Cross-site_request_forgery). However `state` parameter is just a string, so you can include anything that might be useful for your application. |
| `scope`         | Optional | OAuth scopes allow you to specify exactly how your application needs to access Wrike data. This parameter is expressed as a list of comma-delimited, case-sensitive strings. You can find scopes required for each API method in the corresponding section. For example, "Create Task" API method requires the following scopes: `Default, wsReadWrite`.                                                                                                                                                                       |

### 2. Handling authorization code <Anchor label="[RFC6749, 4.1.2.]" target="_blank" href="https://tools.ietf.org/html/rfc6749#section-4.1.2">\[RFC6749, 4.1.2.]</Anchor>

After clicking the authorization URL from the first step, the user is redirected to the Wrike login page (if they aren't already logged in).

The user will be asked to enter the email they use to log in to Wrike and then click **Next**.

<Image align="center" border={true} width="50% " src="https://files.readme.io/fd1a7067617d46fa0fc69c3879056e1e2c51e3f80ce52cb1fc0c55f4cd875c68-login-alphawrkeio-login.png" className="border" />

<br />

They'll be asked to enter their password on the next step.

<Image align="center" border={true} width="50% " src="https://files.readme.io/741b285f12aedd6fa55861d001267f6d1781581c4e60954df29a2eb2c4de80cf-login-alphawrkeio-login-1.png" className="border" />

<br />

After entering a password, the user is redirected to a consent page for confirmation.

<Image align="center" border={true} width="50% " src="https://files.readme.io/6f3a1088e53ea1db5f6a78a6ba071598b0d64b8fe34b5dfefcaae58fcecc3a26-login-alphawrkeio-ui-login-continue.png" className="border" />

<br />

If the user grants access on the consent page, then they will be redirected to the `redirect_uri` with the `code` parameter set to the authorization code and `state` parameter (if one was included).

<Callout icon="🚧" theme="warn">
  Please note that the authorization code is only valid for **10 minutes**.
</Callout>

<Image align="center" border={true} width="100% " src="https://files.readme.io/b8bc80f785e83566ce27fa44e9a9efbb08424d0b5927060f475c3894df988453-download.png" className="border" />

<br />

### 3. Exchanging authorization code for access token <Anchor label="[RFC6749, 4.1.3.]" target="_blank" href="https://tools.ietf.org/html/rfc6749#section-4.1.3">\[RFC6749, 4.1.3.]</Anchor>

Access credentials are requested by executing POST request to a token URL with an authorization code.

**Example request:**

```text
POST https://login.wrike.com/oauth2/token
  //Parameters:
  client_id=<client_id>
  client_secret=<client_secret>
  grant_type=authorization_code
  code=<authorization_code>
```

All parameters here are mandatory. See details about them in the table below:

| PARAMETER       | REQUIRED | DESCRIPTION                                                                                                                                                                                                                                                 |
| --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `client_id`     | Required | The client\_id you obtained in the Initial Setup.                                                                                                                                                                                                           |
| `client_secret` | Required | The client\_secret you obtained in the Initial Setup                                                                                                                                                                                                        |
| `grant_type`    | Required | Must be `authorization_code`                                                                                                                                                                                                                                |
| `code`          | Required | The authorization code you retrieved on the previous step                                                                                                                                                                                                   |
| `redirect_uri`  | Optional | Required, if the `redirect_uri` parameter was included in the authorization request as described in [Section 1. Requesting authorization code](https://developers.wrike.com/wrike-production/docs/oauth-20-authorization#1-requesting-authorization-code-rfc6749-411), and their values must be identical. |

**CURL example:**

```bash
curl -X POST -d "client_id=<client_id>&client_secret=<client_secret>&grant_type=authorization_code&code=<authorization_code>" https://login.wrike.com/oauth2/token
```

**Response example:**

```json
{
  "access_token": "2YotnFZFEjr1zCsicMWpAA",
  "refresh_token": "tGzv3JOkF0XG5Qx2TlKWIA",
  "token_type": "bearer",
  "expires_in": "3600",
  "host": "www.wrike.com"
}
```

<Callout icon="📘" theme="info">
  Please notice the `host` parameter. Wrike stores customer data in several data centers located in USA and European Union and you need to use a specific base URL to access user's data, based on where it is located. All the following requests on behalf of this user should be done using the base URL which you build by using the `host`:
</Callout>

```text
https://<host>/api/v4
```

Please review the [Overview section of the documentation](/docs/overview) to get more details on how we store customer data and why you need to use different base URLs.

### 4. Using access token

Every request to the API should be done using the HTTPS protocol with the access token, which should be passed in the authorization header (preferred option) or the `access_token` parameter. For all requests, you should be using the base URL which you built based on the `host` parameter passed to you on the previous step.

Let's assume that we want to obtain information about yourself. Thus we have to execute the following request:

**Example request:**

```bash
curl -X GET -H "Authorization: bearer <access_token>" https://www.wrike.com/api/v4/contacts?me=true
```

You'll receive the response similar to:

**Example response:**

```json
{
  "kind": "contacts",
  "data": [
    {
      "id": "KUAJ25LC",
      "firstName": "Test",
      "lastName": "User",
      "type": "Person",
      "profiles": [
        {
          "accountId": "IEAGIITR",
          "email": "test.user@myapp.com",
          "role": "User",
          "external": false,
          "admin": false,
          "owner": true
        }
      ],
      "avatarUrl": "https://www.wrike.com/avatars//7E/A2/Box_ffdf2a2e_84-84_v1.png",
      "timezone": "US/Pacific",
      "locale": "en",
      "deleted": false,
      "me": true
    }
  ]
}
```

Each access token is valid for one hour. After the access token has expired, the application should refresh it to continue.

The server response for an expired access token will be as follows:

**Example response:**

```json
{
  "error": "not_authorized",
  "errorDescription": "Access token is unknown or invalid"
}
```

If you're using the wrong base URL, the server will respond with a 401 error:

**Example response:**

```json
{
  "error": "not_authorized",
  "errorDescription": "Access token is unknown or invalid"
}
```

### 5. Refreshing access token <Anchor label="[RFC6749, 6.]" target="_blank" href="https://tools.ietf.org/html/rfc6749#section-6">\[RFC6749, 6.]</Anchor>

Once the access token expires, you will need to use the refresh token to renew it. You can do this by sending a POST request to a token URL with a refresh token.

<Callout icon="📘" theme="info">
  Please bear in mind that you initially get a pair of tokens by querying the [https://login.wrike.com/oauth2/token](https://login.wrike.com/oauth2/token) endpoint, but to refresh the token you need to use the specific base URL, which you built based on the `host` parameter passed to you in the second step.
</Callout>

**Example request:**

```text
POST https://login.wrike.com/oauth2/token
  //Parameters:
  client_id=<client_id>
  client_secret=<client_secret>
  grant_type=refresh_token
  refresh_token=<refresh_token>
  scope=<scope>
```

See details about parameters in the table below:

| PARAMETER       | REQUIRED | DESCRIPTION                                                                                                                                                                                                                                                                                                                                             |
| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `client_id`     | Required | The client\_id you obtained in the Initial Setup.                                                                                                                                                                                                                                                                                                       |
| `client_secret` | Required | The client\_secret you obtained in the Initial Setup                                                                                                                                                                                                                                                                                                    |
| `grant_type`    | Required | Must be `refresh_token`                                                                                                                                                                                                                                                                                                                                 |
| `refresh_token` | Required | The refresh token you retrieved in step 3                                                                                                                                                                                                                                                                                                               |
| `scope`         | Optional | OAuth scopes allow you to specify exactly how your application needs to access Wrike data. This parameter is expressed as a list of comma-delimited, case-sensitive strings. You can find scopes required for each API method in the corresponding section. For example, "Create Task" API method requires the following scopes: `Default, wsReadWrite` |

**CURL example:**

```bash
curl -X POST -d "client_id=<client_id>&client_secret=<client_secret>&grant_type=refresh_token&refresh_token=<refresh_token>&scope=<scope>" https://login.wrike.com/oauth2/token
```

The refresh operation returns a new access token and a new refresh token, making the old refresh token invalid.

***

<span class="wrike-section-label">Permanent token</span>

## Permanent access token

Generally for production purposes, OAuth 2.0 is the preferred method of authorization in the Wrike API. However if you'd like to simply test the API features or create an application which is not intended to be used by multiple users, you can use an alternative approach — the permanent token.

The permanent token is a normal token that never expires: you can obtain it once and then use it as long as you want without needing to refresh or re-authenticate. This means you can build standalone integrations without any web server to support the OAuth 2.0 authorization flow.

Wrike stores customer data in several data centers. There are data centers located in the USA and European Union, you need to use a specific base URL to access user's data, based on where it is located. All the requests should be done using the base URL, which you can determine by looking at the URL in the address bar when you access your Wrike instance in a browser.

### Obtaining a permanent token

To receive a permanent token you need to open your application on the <Anchor label="App Console" target="_blank" href="https://www.wrike.com/appconsole.htm?#/api">App Console</Anchor> and click **Get token**.

A pop-up window opens where you must:

* Enter your password.

<Image align="center" border={true} width="80% " src="https://files.readme.io/449ee647c3d655203faf9242fbcc82bde96d477472ac59cbdbeaf1dc5421653a-Screenshot_2026-04-01_at_10.05.51_PM.png" className="border" />

<br />

That's it. The ease of getting started is why the permanent token is the best way to begin working with Wrike's API.

<Callout icon="❗" theme="error">
  But be careful! The permanent token allows applications to gain access to all data in a certain Wrike account on your behalf. Keep your permanent token private and revoke it when you no longer need it.
</Callout>

<Callout icon="🚧" theme="warn">
  Please note that your token is only shown once - write it down and keep in a safe place.
</Callout>

### Revoking a permanent token

To revoke a previously created permanent token, you need to open your application <Anchor label="App Console" target="_blank" href="https://www.wrike.com/appconsole.htm?#/api">App Console</Anchor>, find your token, and click **Revoke token** link.

<Image align="center" border={true} width="70% " src="https://files.readme.io/337e3aeddd9cae86719b88280197cdff7325ab482cf01975d2d9cef530c1dbae-Screenshot_2026-04-01_at_10.07.12_PM.png" className="border" />

<br />

### Actions that revoke API tokens

API tokens (both permanent and OAuth 2.0) become revoked when:

* User manually revokes the token in API app settings
* User resets their password
* User becomes deactivated
* Admin signs in as the token author with **Log in as this user** button in AM (this action includes deactivation)
* Account admin changes password strength policy
  * This action logs the user out and forces the password reset, if it does not meet the requirements. However, if the password does meet the requirements, the user is not logged out, but the existing tokens still become invalidated.

### Next Steps

<div class="wrike-cards-grid">
  <a href="/reference/gettasksempty" class="wrike-nav-card">
    <div class="wrike-card-icon">
      <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#0A615A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
        <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />

        <polyline points="14 2 14 8 20 8" />
      </svg>
    </div>

    <div class="wrike-card-title">API Methods</div>
    <div class="wrike-card-desc">Explore API methods to get maximum value from your Wrike integration.</div>
    <div class="wrike-card-link">Browse reference <span class="wrike-arrow">→</span></div>
  </a>

  <a href="https://www.wrike.com/contactus/" class="wrike-nav-card">
    <div class="wrike-card-icon">
      <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#0A615A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
        <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
      </svg>
    </div>

    <div class="wrike-card-title">Wrike Support Team</div>
    <div class="wrike-card-desc">If you have any questions or feedback, feel free to contact Wrike Support Team.</div>
    <div class="wrike-card-link">Contact support <span class="wrike-arrow">→</span></div>
  </a>

  <a href="https://community.wrike.com/categories/200428765-API-and-Developers" class="wrike-nav-card">
    <div class="wrike-card-icon">
      <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#0A615A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
        <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" />

        <circle cx="9" cy="7" r="4" />

        <path d="M23 21v-2a4 4 0 0 0-3-3.87" />

        <path d="M16 3.13a4 4 0 0 1 0 7.75" />
      </svg>
    </div>

    <div class="wrike-card-title">API Community</div>
    <div class="wrike-card-desc">Visit our API Community section on the Wrike Help portal.</div>
    <div class="wrike-card-link">Join community <span class="wrike-arrow">→</span></div>
  </a>
</div>