> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.dropboxapi.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.dropboxapi.com/_mcp/server.

# Get Temporary Upload Link

POST https://api.dropboxapi.com/2/files/get_temporary_upload_link
Content-Type: application/json

Get a one-time use temporary upload link to upload a file to a Dropbox location.  This
endpoint acts as a delayed upload(). The returned temporary upload link may be used to make
a POST request with the data to be uploaded. The upload will then be perfomed with the
CommitInfo previously provided to getTemporaryUploadLink() but evaluated only upon consumption.
Hence, errors stemming from invalid CommitInfo with respect to the state of the user's Dropbox
will only be communicated at consumption time. Additionally, these errors are surfaced as
generic HTTP 409 Conflict responses, potentially hiding issue details. The maximum temporary
upload link duration is 4 hours. Upon consumption or expiration, a new link will have to be
generated. Multiple links may exist for a specific upload path at any given time.  The POST
request on the temporary upload link must have its Content-Type set to
"application/octet-stream".  Example temporary upload link consumption request:  curl -X POST
\<temporary\_upload\_link\_url> --header
"Content-Type: application/octet-stream" --data-binary @local\_file.txt  A successful temporary
upload link consumption request returns the content hash of the uploaded data in JSON format.
Example successful temporary upload link consumption response: \{"content-hash":
"599d71033d700ac892a0e48fa61b125d2f5994"}  An unsuccessful temporary upload link consumption
request returns any of the following status codes:  HTTP 400 Bad Request: Content-Type is not
one of application/octet-stream and text/plain or request is invalid. HTTP 409 Conflict: The
temporary upload link does not exist or is currently unavailable, the upload failed, or
another error happened. HTTP 410 Gone: The temporary upload link is expired or consumed.
Example unsuccessful temporary upload link consumption response: Temporary upload link has
been recently consumed.

**Required scope:** `files.content.write`

**Endpoint format:** [RPC](https://docs.dropboxapi.com/dropbox-api/docs/technical-reference/request-response-formats#rpc-endpoints)

**Authentication:** [User](https://docs.dropboxapi.com/dropbox-api/docs/auth-types#user-authentication)

Reference: https://docs.dropboxapi.com/dropbox-api/api-reference/user-endpoints/files/get-temporary-upload-link

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 token issued to a specific user. Use `Authorization: Bearer <token>`. Public clients should use the authorization code flow with PKCE (S256). For background or offline access, send `token_access_type=offline` during authorization and use the returned refresh token to obtain new access tokens. You can generate a short-lived access token from the App Console; see [Testing with a generated token](https://docs.dropboxapi.com/dropbox-api/docs/oauth#testing-with-a-generated-token).

## Request

### Headers

- `Dropbox-API-Select-User` (string, optional) — Acts on behalf of a team member for supported user-auth operations. Pass a team member ID such as `dbmid:...`. When used with a team token, that token must also include the `team_data.member` scope.
- `Dropbox-API-Path-Root` (string, optional) — Scopes path-based operations to a namespace (root). The value is a JSON serialization of the `common.PathRoot` union: `{".tag": "home"}`, `{".tag": "root", "root": "<namespace_id>"}`, or `{".tag": "namespace_id", "namespace_id": "<namespace_id>"}`. On failure the request returns 422 with a `common.PathRootError`.

### Body (application/json)

This endpoint expects an object.

- `commit_info` (object, required) — Contains the path and other optional modifiers for the future upload commit. Equivalent to the parameters provided to [upload](api:dropbox-api:POST/2/files/upload).
  - `path` (string, required) — Path in the user's Dropbox to save the file.
  - `autorename` (boolean, optional) — If there's a conflict, as determined by `mode`, have the Dropbox server try to autorename the file to avoid conflict.
  - `client_modified` (datetime, optional, nullable) — The value to store as the `client_modified` timestamp. Dropbox automatically records the time at which the file was written to the Dropbox servers. It can also record an additional timestamp, provided by Dropbox desktop clients, mobile clients, and API apps of when the file was actually created or modified.
  - `mode` (object or object or object, optional, nullable) — Selects what to do if the file already exists.
    - files.WriteMode.add
      - `.tag` (enum, required)
        - Allowed values: `add`
    - files.WriteMode.overwrite
      - `.tag` (enum, required)
        - Allowed values: `overwrite`
    - files.WriteMode.update
      - `.tag` (enum, required)
        - Allowed values: `update`
      - `update` (string, required, nullable)
  - `mute` (boolean, optional) — Normally, users are made aware of any file modifications in their Dropbox account via notifications in the client software. If `true`, this tells the clients that this modification shouldn't result in a user notification.
  - `property_groups` (list of object, optional, nullable) — List of custom properties to add to file.
    - `fields` (list of object, required) — The actual properties associated with the template. There can be up to 32 property types per template.
      - `name` (string, required) — Key of the property field associated with a file and template. Keys can be up to 256 bytes.
      - `value` (string, required) — Value of the property field associated with a file and template. Values can be up to 1024 bytes.
    - `template_id` (string, required) — A unique identifier for the associated template.
  - `strict_conflict` (boolean, optional) — Be more strict about how each `WriteMode` detects conflict. For example, always return a conflict error when `mode` = `WriteMode.update` and the given "rev" doesn't match the existing file's "rev", even if the existing file has been deleted. This also forces a conflict even when the target path refers to a file with identical contents.
- `duration` (double, optional, default: 14400) — How long before this link expires, in seconds. Attempting to start an upload with this link longer than this period of time after link creation will result in an error.

## Response

### 200

Successful response

- `link` (string, required) — The temporary link which can be used to stream a file to a Dropbox location.

## Errors

### 401 Unauthorized Error

Bad or expired token

- `error` (object or object or object or object or object or object or object or object, required) — Errors occurred during authentication.
  - auth_apiv2.AuthError.invalid_access_token
    - `.tag` (enum, required)
      - Allowed values: `invalid_access_token`
  - auth_apiv2.AuthError.invalid_select_user
    - `.tag` (enum, required)
      - Allowed values: `invalid_select_user`
  - auth_apiv2.AuthError.invalid_select_admin
    - `.tag` (enum, required)
      - Allowed values: `invalid_select_admin`
  - auth_apiv2.AuthError.user_suspended
    - `.tag` (enum, required)
      - Allowed values: `user_suspended`
  - auth_apiv2.AuthError.expired_access_token
    - `.tag` (enum, required)
      - Allowed values: `expired_access_token`
  - auth_apiv2.AuthError.missing_scope
    - `.tag` (enum, required)
      - Allowed values: `missing_scope`
    - `required_scope` (string, required) — The required scope to access the route.
  - auth_apiv2.AuthError.route_access_denied
    - `.tag` (enum, required)
      - Allowed values: `route_access_denied`
  - Other
    - `.tag` (string, optional)
- `error_summary` (string, required) — A human-readable summary of the error.

### 403 Forbidden Error

The user or team account doesn't have access to the endpoint or feature

- `error` (object or object or object or object or object, required) — Error occurred because the account doesn't have permission to access the resource.
  - auth_apiv2.AccessError.invalid_account_type
    - `.tag` (enum, required)
      - Allowed values: `invalid_account_type`
    - `invalid_account_type` (object or object or object, required)
      - auth_apiv2.InvalidAccountTypeError.endpoint
        - `.tag` (enum, required)
          - Allowed values: `endpoint`
      - auth_apiv2.InvalidAccountTypeError.feature
        - `.tag` (enum, required)
          - Allowed values: `feature`
      - Other
        - `.tag` (string, optional)
  - auth_apiv2.AccessError.paper_access_denied
    - `.tag` (enum, required)
      - Allowed values: `paper_access_denied`
    - `paper_access_denied` (object or object or object, required)
      - auth_apiv2.PaperAccessError.paper_disabled
        - `.tag` (enum, required)
          - Allowed values: `paper_disabled`
      - auth_apiv2.PaperAccessError.not_paper_user
        - `.tag` (enum, required)
          - Allowed values: `not_paper_user`
      - Other
        - `.tag` (string, optional)
  - auth_apiv2.AccessError.team_access_denied
    - `.tag` (enum, required)
      - Allowed values: `team_access_denied`
  - auth_apiv2.AccessError.no_permission
    - `.tag` (enum, required)
      - Allowed values: `no_permission`
    - `no_permission` (object or object, required)
      - auth_apiv2.NoPermissionError.unauthorized_account_id_usage
        - `.tag` (enum, required)
          - Allowed values: `unauthorized_account_id_usage`
        - `unauthorized_account_ids` (list of string, required) — The account IDs that the caller does not have permission to use.
      - Other
        - `.tag` (string, optional)
  - Other
    - `.tag` (string, optional)
- `error_summary` (string, required) — A human-readable summary of the error.

### 409 Conflict Error

No endpoint-specific errors

- `any`

### 429 Too Many Requests Error

The app is making too many requests for the given user or team and is being rate limited. The app should wait for the number of seconds specified in the "Retry-After" response header before trying again.

- `error` (object, required) — Error occurred because the app is being rate limited.
  - `reason` (object or object or object, required) — The reason why the app is being rate limited.
    - auth_apiv2.RateLimitReason.too_many_requests
      - `.tag` (enum, required)
        - Allowed values: `too_many_requests`
    - auth_apiv2.RateLimitReason.too_many_write_operations
      - `.tag` (enum, required)
        - Allowed values: `too_many_write_operations`
    - Other
      - `.tag` (string, optional)
  - `retry_after` (uint64, optional, default: 1) — The number of seconds that the app should wait before making another request.
- `error_summary` (string, required) — A human-readable summary of the error.

### 500 Internal Server Error

Internal server error. An error occurred on the Dropbox servers. Check https://status.dropbox.com/ for announcements about Dropbox service issues.

- `any`

## Examples

**Request**

```json
{
  "commit_info": {
    "path": "/Homework/math/Matrices.txt",
    "autorename": true
  },
  "duration": 3600
}
```

**Response**

```json
{
  "link": "https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND"
}
```

**SDK Code**

```python
import requests

url = "https://api.dropboxapi.com/2/files/get_temporary_upload_link"

payload = {
    "commit_info": {
        "path": "/Homework/math/Matrices.txt",
        "autorename": True
    },
    "duration": 3600
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.dropboxapi.com/2/files/get_temporary_upload_link';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"commit_info":{"path":"/Homework/math/Matrices.txt","autorename":true},"duration":3600}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.dropboxapi.com/2/files/get_temporary_upload_link"

	payload := strings.NewReader("{\n  \"commit_info\": {\n    \"path\": \"/Homework/math/Matrices.txt\",\n    \"autorename\": true\n  },\n  \"duration\": 3600\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.dropboxapi.com/2/files/get_temporary_upload_link")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"commit_info\": {\n    \"path\": \"/Homework/math/Matrices.txt\",\n    \"autorename\": true\n  },\n  \"duration\": 3600\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.dropboxapi.com/2/files/get_temporary_upload_link")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"commit_info\": {\n    \"path\": \"/Homework/math/Matrices.txt\",\n    \"autorename\": true\n  },\n  \"duration\": 3600\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.dropboxapi.com/2/files/get_temporary_upload_link', [
  'body' => '{
  "commit_info": {
    "path": "/Homework/math/Matrices.txt",
    "autorename": true
  },
  "duration": 3600
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.dropboxapi.com/2/files/get_temporary_upload_link");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"commit_info\": {\n    \"path\": \"/Homework/math/Matrices.txt\",\n    \"autorename\": true\n  },\n  \"duration\": 3600\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "commit_info": [
    "path": "/Homework/math/Matrices.txt",
    "autorename": true
  ],
  "duration": 3600
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.dropboxapi.com/2/files/get_temporary_upload_link")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```