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

# Upload a File

> Upload a file to the Tela API

## Uploading a File

Using this endpoint you can request a temporary URL to upload a file to Tela's storage.

Here's an code example on how to do it:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const { download_url, upload_url: uploadUrl } = await fetch(
    'https://api.tela.com/v2/file', 
    { method: 'POST' }
  ).then(res => res.json())

  await fetch(uploadUrl, { method: 'PUT', body: file })
  ```

  ```python Python theme={null}
  import requests

  response = requests.post('https://api.tela.com/v2/file')
  upload_url = response.json().upload_url

  file = open('path/to/file', 'rb')
  requests.put(upload_url, data=file)
  ```
</CodeGroup>


## OpenAPI

````yaml POST /v2/file
openapi: 3.0.1
info:
  title: Tela API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tela.com
security: []
paths:
  /v2/file:
    post:
      description: Creates a url for a file upload
      responses:
        '200':
          description: Successful completion
          content:
            application/json:
              schema:
                type: object
                properties:
                  upload_url:
                    description: The URL to upload the file
                    type: string
                  download_url:
                    description: The URL to download the file
                    type: string
                example:
                  upload_url: >-
                    https://file-upload-temporary.9161f3bf787dfc457efb6c4fc312e229.r2.cloudflarestorage.com/3478889e-32fb-4267-9608-d83555b88261/fl_fghme5tu2jesklct5sf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=46f3b221e20b2c259a3f7259cc387d24%2F20241008%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20241008T145809Z&X-Amz-Expires=900&X-Amz-Signature=e63145dc80b75fa489318e23806cd484f8503c33c113cf08990fe2e3d9a3d12c&X-Amz-SignedHeaders=host&x-id=PutObject
                  download_url: >-
                    https://tmp.files.tela.com/3478483e-322b-1867-9608-d83555b81261/fl_fghme5tu2xeaklct5sf

````