---
title: dots.v2.genAi.oauth2.dropbox.tokens.post()
description: Get Oauth2 Dropbox Tokens
product: Reference
url: https://docs.digitalocean.com/reference/dots/reference/agent-platform-api/genai-create-oauth2-dropbox-tokens/
last_updated: "2026-10-27"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# dots.v2.genAi.oauth2.dropbox.tokens.post()

Generated on 27 Oct 2026 from DoTs version [`v1.21.0`](https://github.com/digitalocean/dots/releases/tag/v1.21.0)

## Usage

```typescript
client.v2.genAi.oauth2.dropbox.tokens.post(body: ApiDropboxOauth2GetTokensInput, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | ApiDropboxOauth2GetTokensOutput>
```

## Description

To obtain the refresh token, needed for creation of data sources, send a GET request to [`/v2/gen-ai/oauth2/dropbox/tokens`](https://docs.digitalocean.com/reference/api/reference/agent-platform-api/index.html.md#genai_create_oauth2_dropbox_tokens). Pass the code you obtrained from the oauth flow in the field ‘code’

## Parameters

`code` string optional

Example: `example string`

The oauth2 code from google

`redirectUrl` string optional

Example: `example string`

Redirect url

## Request Sample

## Show Request Sample

```typescript
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.genAi.oauth2.dropbox.tokens.post({
    code: "example string",
    redirectUrl: "example string",
});
```

## Response Example

## Show Response Example

```json
{
  "refresh_token": "example string",
  "token": "example string"
}
```

## More Information

See [`/v2/gen-ai/oauth2/dropbox/tokens`](https://docs.digitalocean.com/reference/api/reference/agent-platform-api/index.html.md#genai_create_oauth2_dropbox_tokens) in the API reference for additional detail on responses, headers, parameters, and more.