---
title: "Get a token to upload files to the data plane API."
method: POST
path: "/files/upload-token"
tags: ["Data Plane Tokens"]
---

# Get a token to upload files to the data plane API.

`POST /files/upload-token`

## Request

- Base URL: `https://replace-with-account.api.decodable.co/v1alpha2`
- URL: `https://replace-with-account.api.decodable.co/v1alpha2/files/upload-token`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/decodable/apis/decodable-control-plane/docs/files/upload-token/post.ts> (a function with typed inputs; its response is checked against the schema)

Requires permission matching: `file:write:default.<file-name>`, for each name included in the request.

## Query parameters

- `token-validity-seconds` number

## Request body

- object
  - `names` string[], required

## Response `200`

A request and token issued by the control plane API for use with the data plane API.

- object
  - `token` string, required: A JWT token issued by the control plane API permitting a specific request to the data plane.
  - `data_plane_request` string: A stringified json request body for the data plane API which is permitted and signed by the associated JWT token. It must be sent verbatim (including whitespace) in order to match the token signature.

## Other responses

- `403`: Access denied: requesting user lacks a required permission.

---

[API](https://skmtc.dev/decodable/apis/decodable-control-plane.md) - [All operations](https://skmtc.dev/decodable/apis/decodable-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/decodable/apis/decodable-control-plane/revisions/9718a3019da8?raw)
