---
title: "Upload file initialization"
url: "https://earlyaccess.developers.bynder.com/apis/asset-api-beta-1/versions/d41a5f27-191a-4019-9419-fe0a53e55978/operations/postUploadUrlInitialization"
---

> Full API specification: https://earlyaccess.developers.bynder.com/apis/asset-api-beta-1/versions/d41a5f27-191a-4019-9419-fe0a53e55978.md

# Upload file initialization

`POST` `/`

Operation ID: `postUploadUrlInitialization`

> **IMPORTANT NOTE** > These APIs do not replace the existing v4 APIs yet, and currently only applies to newly uploaded assets still in Draft state (before publishing). Cannot be yet used for Assets that are in Asset Bank and Waiting room. This step actually starts uploading the file. Send this request to the signed `uploadUrl` returned by **Create upload url**. This initializes a resumable (tus) upload. Any file namings have to be base64 encoded/decoded. The response headers - in particular the `Location` header - are required for the next call, **Upload file chunks**. > The `{uploadUrl}` path parameter is a placeholder for the signed URL from the previous step.

## Header parameters

- `tus-resumable` (string, required)
- `upload-length` (string, required) - Total size of the file to upload, in bytes.
- `upload-metadata` (string, required) - Comma-separated `key <base64-value>` pairs, e.g. `filename ZXhhbXBsZS5wbmc=`.
- `fileid` (string, required)
- `filename` (string, required)
- `authorization` (string, required)
- `content-length` (string, required)

## Responses

- `200` - Upload initialized. Use the returned Location header for the chunk uploads.
- `400`
- `401`
- `403`

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Asset API (Beta)
  version: 1.0.0-beta
servers:
  - url: https://{your-bynder-domain}/
paths:
  /:
    post:
      description: >-
        > **IMPORTANT NOTE**

        > These APIs do not replace the existing v4 APIs yet, and currently only
        applies to newly uploaded assets still in Draft state (before
        publishing). Cannot be yet used for Assets that are in Asset Bank and
        Waiting room. 

         This step actually starts uploading the file. Send this request to the signed `uploadUrl` returned by **Create upload url**. This initializes a resumable (tus) upload. Any file namings have to be base64 encoded/decoded. 
        The response headers - in particular the `Location` header - are
        required for the next call, **Upload file chunks**. 

        > The `{uploadUrl}` path parameter is a placeholder for the signed URL
        from the previous step.
      operationId: postUploadUrlInitialization
      parameters:
        - in: header
          name: tus-resumable
          required: true
          schema:
            default: 1.0.0
            type: string
        - description: Total size of the file to upload, in bytes.
          in: header
          name: upload-length
          required: true
          schema:
            type: string
        - description: Comma-separated `key <base64-value>` pairs, e.g. `filename
            ZXhhbXBsZS5wbmc=`.
          in: header
          name: upload-metadata
          required: true
          schema:
            contentEncoding: base64
            type: string
        - in: header
          name: fileid
          required: true
          schema:
            type: string
        - in: header
          name: filename
          required: true
          schema:
            type: string
        - in: header
          name: authorization
          required: true
          schema:
            type: string
        - in: header
          name: content-length
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Upload initialized. Use the returned Location header for the chunk
            uploads.
          headers:
            Content-Length:
              schema:
                type: integer
            Tus-Resumable:
              schema:
                type: string
            Upload-Chunk-Size:
              schema:
                type: integer
            X-Content-Type-Options:
              schema:
                type: string
            location:
              description: URL to send the file chunks to (used by Upload file chunks).
              schema:
                type: string
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequestError"
          description: ""
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UnauthorizedError"
          description: ""
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForbiddenError"
          description: ""
      security:
        - httpAuth: []
      servers:
        - description: Dynamic Tus upload server returned in the previous step.
          url: "{uploadUrl}"
          variables:
            baseUploadUrl:
              default: "{your-dynamic-upload-url}"
      summary: Upload file initialization
      tags:
        - Asset ingestion
security:
  - httpAuth: []
components:
  schemas:
    BadRequestError:
      properties:
        message:
          type: string
      title: BadRequestError
      type: object
    UnauthorizedError:
      properties:
        message:
          type: string
      title: UnauthorizedError
      type: object
    ForbiddenError:
      properties:
        message:
          type: string
      title: ForbiddenError
      type: object
  securitySchemes:
    httpAuth:
      scheme: bearer
      type: http
```
