---
title: "Uploads a file associated with a binding."
method: POST
path: "/api/binding"
tags: ["Bindings"]
---

# Uploads a file associated with a binding.

`POST /api/binding`

## Request

- Base URL: `https://passivelogic.com` (the document declares no server; this is the origin it was published from)
- URL: `https://passivelogic.com/api/binding`
- Auth: one of:
  - API key in header `X-PL-AUTH`
  - API key in header `Authorization: PL-API-KEY`
  - API key in header `PL-API-KEY`
  - HTTP basic
- TypeScript: <https://skmtc.dev/passivelogic/apis/passivelogic-http-api/docs/api/binding/post.ts> (a function with typed inputs; its response is checked against the schema)

Uploads a file to the server and associates that file with a binding node, setting its new stored URL & checksum in the
database. The data may be sent in either multipart/form-data or JSON format. If using JSON, the image file must be
Base64-encoded. Using multipart/form-data is recommended as it is a more efficient way to transmit binary data.

## Request body

- UploadFileData: Data required to upload a file binding.
  - `ID` string, uuid, required: UUID of the quantum binding node that you want to associate this file with.
  - `file` string, byte, required: File data to write to the server.
  - `fileType` string, required: The type of file the given data represents.

## Response `200`

OK

- BindingUploadResponse: Binding response definition
  - `url` string, nullable
  - `message` string, required: Informative message relating to binding upload. Updated binding url with cache bust.

---

[API](https://skmtc.dev/passivelogic/apis/passivelogic-http-api.md) - [All operations](https://skmtc.dev/passivelogic/apis/passivelogic-http-api/llms.txt) - [OpenAPI document](https://skmtc.dev/passivelogic/apis/passivelogic-http-api/revisions/28fce63bcdbb?raw)
