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

# Upload File

> Upload images or videos (multipart form)

Upload image or video files using multipart form data.

## Parameters

<ParamField body="unique_id" type="string" required>
  Bucket ID to upload to
</ParamField>

<ParamField body="file" type="file" required>
  Image or video file
</ParamField>

<ParamField body="tags" type="string">
  Comma-separated tags or JSON array
</ParamField>

<ParamField body="latitude" type="string">
  GPS latitude
</ParamField>

<ParamField body="longitude" type="string">
  GPS longitude
</ParamField>

## Examples

<RequestExample>
  ```python Image theme={null}
  import requests

  response = requests.post(
      "https://memoryapi-production.up.railway.app/upload/file",
      headers={"X-API-Key": "xinobi"},
      data={"unique_id": "your-bucket-id"},
      files={"file": open("photo.jpg", "rb")}
  )
  ```

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

  response = requests.post(
      "https://memoryapi-production.up.railway.app/upload/file",
      headers={"X-API-Key": "xinobi"},
      data={
          "unique_id": "your-bucket-id",
          "tags": "vacation, beach"
      },
      files={"file": open("video.mp4", "rb")}
  )
  ```

  ```bash cURL Image theme={null}
  curl -X POST "https://memoryapi-production.up.railway.app/upload/file" \
    -H "X-API-Key: xinobi" \
    -F "unique_id=your-bucket-id" \
    -F "file=@photo.jpg"
  ```
</RequestExample>

<ResponseExample>
  ```json Image theme={null}
  {
    "uploads": {
      "image": {
        "code": "0000",
        "msg": "success",
        "data": [{ "id": "651750900880375808" }]
      }
    }
  }
  ```

  ```json Video theme={null}
  {
    "uploads": {
      "video": {
        "code": "0000",
        "msg": "success",
        "data": { "videoNo": "VI651752673251721216", "videoName": "my_video" }
      }
    }
  }
  ```
</ResponseExample>
