> ## Documentation Index
> Fetch the complete documentation index at: https://www.dropfans.io/developers/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /api/external/v1/vault — Upload an image, small video or voice message

> Uploads one file into the creator's vault as `multipart/form-data`.

- Source: https://www.dropfans.io/developers/reference/upload-vault-item
- Section: API reference
- OpenAPI: https://www.dropfans.io/developers/openapi.json

Also served at `/api/external/vault` (the unversioned alias).

Uploads one file into the creator's vault as `multipart/form-data`.

Three kinds, three shapes: **images** need two parts — a pre-compressed `displayFile` and a `thumbnailFile` (both JPEG); **audio** (voice messages) sends one `file` part (≤20MB, ≤60 min); **video** sends one `file` part — but the whole request must stay under ~4MB (a platform body cap rejects bigger requests before the app runs), so for real videos use the three-step TUS flow starting at [POST /api/external/v1/vault/video-upload](https://www.dropfans.io/developers/reference/start-video-upload.md) instead.

Every upload enters the same moderation pipeline as a dashboard upload: images are scored immediately, videos asynchronously, audio goes to human review (or auto-approves for trusted creators). The item only shows up in the default vault list once APPROVED.

## Authentication

`Authorization: Bearer dpfn_...` — an API key generated in the dashboard (Vault → API Connect). By default the key acts for the one account it belongs to. Missing or invalid keys return 401 `{"error":"Unauthorized","code":"unauthorized"}`.

**For a creator you manage or onboarded:** `POST /api/external/v1/creators/{creatorId}/vault` — with a verified agency's own key for a creator or AI persona it manages, or your app owner's own key for an account your app onboarded (ids from GET /api/external/v1/creators); for a managed creator the agency needs `canManageVault`. The response echoes the account acted on in `X-Dropfans-Account`. Sending `X-Dropfans-Account: <account id>` on the plain path still works but is deprecated.

## Request body (multipart/form-data)

| Field | Type | Required | Description |
|---|---|---|---|
| `fileType` | `image` \\| `video` \\| `audio` | yes | What you are uploading. |
| `originalName` | string | yes | The file’s name, stored as fileName. |
| `folderId` | string |  | Optional folder to file the item into. |
| `durationSeconds` | integer |  | Audio only — the voice message length in seconds (capped at 3600). |
| `displayFile` | file |  | Images only (required): the pre-compressed JPEG display copy. |
| `thumbnailFile` | file |  | Images only (required): the JPEG thumbnail. |
| `file` | file |  | Video/audio only (required): the media file. Audio ≤20MB; video effectively ≤~4MB here — use the TUS flow for anything bigger. |

Example — Image upload (display + thumbnail parts):

```json
{
  "fileType": "image",
  "originalName": "beach-set-01.jpg",
  "displayFile": "@photo.jpg",
  "thumbnailFile": "@photo-thumb.jpg"
}
```

Example — Voice message:

```json
{
  "fileType": "audio",
  "originalName": "voice-note.ogg",
  "durationSeconds": 42,
  "file": "@voice-note.ogg"
}
```

## Responses

### 200

Uploaded. The item starts PENDING moderation (not included in this shape — poll the list with includePending=true, or wait for it to appear in the default list).

| Field | Type | Required | Description |
|---|---|---|---|
| `success` | boolean | yes | Always true. |
| `item` | VaultItemUploaded | yes | The new vault item. |

```json
{
  "success": true,
  "item": {
    "id": "clxv1a2b30001item",
    "fileName": "beach-set-01.jpg",
    "filePath": "https://cdn.dropfans.io/valeria/vault/1721990000-ab12cd.jpg",
    "thumbnailPath": "https://cdn.dropfans.io/valeria/thumbnails/1721990000-ab12cd.jpg",
    "fileType": "image",
    "fileSize": 482113,
    "durationSeconds": null,
    "bunnyStreamId": null,
    "createdAt": "2026-08-01T10:15:00.000Z"
  }
}
```

## Errors

| Status | Body | When |
|---|---|---|
| 400 | `{"error":"Missing required fields: fileType and originalName"}` | Either required form field is absent. |
| 400 | `{"error":"Only images, videos and audio are allowed"}` | `fileType` is anything other than image, video or audio. |
| 400 | `{"error":"Missing displayFile or thumbnailFile for image upload"}` | Image upload without both file parts. |
| 400 | `{"error":"Missing video file"}` | fileType=video without a `file` part. |
| 400 | `{"error":"Missing audio file"}` | fileType=audio without a `file` part. |
| 401 | `{"error":"Unauthorized","code":"unauthorized"}` | Missing or invalid API key. |
| 413 | `{"error":"Audio too large"}` | Audio file over 20MB. |
| 500 | `{"error":"Failed to upload file"}` | Storage or moderation kickoff failed — retry later. |
| 400 | `{"error":"X-Dropfans-Account must be an account id (from GET /api/external/agency/creators), not a username.","code":"invalid_account_header"}` | `X-Dropfans-Account` is not an account id. |
| 400 | `{"error":"X-Dropfans-Account names a different account than the path — send one or the other.","code":"account_mismatch"}` | Called under /v1/creators/{creatorId}/ with an `X-Dropfans-Account` naming another account. |
| 403 | `{"error":"This key cannot act for that account.","code":"account_not_managed"}` | The creator in the path (or `X-Dropfans-Account`) is one this key cannot act for: no ACCEPTED management by your agency and not an account your app onboarded (or it no longer holds a key bound to your app), a key minted for one creator, or someone is suspended, banned or deleted. An unknown id gets the same answer. |
| 403 | `{"error":"The agency does not have permission for this on that account.","code":"permission_denied","permission":"canManageVault"}` | For a managed creator: the agency lacks `canManageVault` on that account. |
| 403 | `{"error":"This app does not have the vault API category enabled. Contact support to enable it.","code":"api_category_disabled","category":"vault"}` | Your app has the Vault [API category](https://www.dropfans.io/developers/concepts/api-categories.md) switched off. |

## Notes

The success shape here differs from the video-complete endpoint's item (that one adds `moderationStatus`, `moderationTags` and `aiEnhanced` and omits `durationSeconds`). OPTIONS on this path is an unauthenticated CORS preflight for browser uploads.

## Rate limiting

Per-key fixed windows by tier (Personal 60/min · 5,000/day; approved apps 300/min · 50,000/day; Dropfans-operated integrations exempt). Read the live values from X-RateLimit-Tier, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and their -Day variants; a 429 carries Retry-After and `{"error":"Rate limit exceeded","code":"rate_limited"}`. See [Rate limits](https://www.dropfans.io/developers/concepts/rate-limits.md).

## Code samples

### curl

```bash
curl -X POST "https://www.dropfans.io/api/external/v1/vault" \
  -H "Authorization: Bearer $DROPFANS_API_KEY" \
  -F "fileType=image" \
  -F "originalName=beach-set-01.jpg" \
  -F "displayFile=@photo.jpg" \
  -F "thumbnailFile=@photo-thumb.jpg"
```

### Node

```javascript
import { readFile } from 'node:fs/promises';

const form = new FormData();
form.append('fileType', "image");
form.append('originalName', "beach-set-01.jpg");
form.append('displayFile', new Blob([await readFile('photo.jpg')]), 'photo.jpg');
form.append('thumbnailFile', new Blob([await readFile('photo-thumb.jpg')]), 'photo-thumb.jpg');

const res = await fetch(`https://www.dropfans.io/api/external/v1/vault`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.DROPFANS_API_KEY}`,
  },
  body: form,
});
console.log(await res.json());
```

### Python

```python
import os
import requests

res = requests.post(
    "https://www.dropfans.io/api/external/v1/vault",
    headers={"Authorization": f"Bearer {os.environ['DROPFANS_API_KEY']}"},
    files={
        "displayFile": open("photo.jpg", "rb"),
        "thumbnailFile": open("photo-thumb.jpg", "rb"),
    },
    data={
        "fileType": "image",
        "originalName": "beach-set-01.jpg",
    },
)
print(res.json())
```

## OpenAPI

```json
{
  "method": "POST",
  "path": "/api/external/v1/vault",
  "operationId": "uploadVaultItem",
  "tags": [
    "vault"
  ],
  "summary": "Upload an image, small video or voice message",
  "description": "Uploads one file into the creator's vault as `multipart/form-data`.\n\nThree kinds, three shapes: **images** need two parts — a pre-compressed `displayFile` and a `thumbnailFile` (both JPEG); **audio** (voice messages) sends one `file` part (≤20MB, ≤60 min); **video** sends one `file` part — but the whole request must stay under ~4MB (a platform body cap rejects bigger requests before the app runs), so for real videos use the three-step TUS flow starting at [POST /api/external/v1/vault/video-upload](https://www.dropfans.io/developers/reference/start-video-upload.md) instead.\n\nEvery upload enters the same moderation pipeline as a dashboard upload: images are scored immediately, videos asynchronously, audio goes to human review (or auto-approves for trusted creators). The item only shows up in the default vault list once APPROVED.",
  "parameters": [
    {
      "name": "X-Dropfans-Account",
      "in": "header",
      "required": false,
      "deprecated": true,
      "description": "Deprecated: call the …ForCreator operation (/api/external/v1/creators/{creatorId}/…) instead; the header keeps working and such responses carry Deprecation and Link: rel=\"successor-version\". With a verified agency’s own key, the id of a creator or AI persona the agency manages (from GET /api/external/v1/agency/creators): the request then acts as that account, exactly as if it were sent with that account’s own key. Account ids only — usernames are refused (400 invalid_account_header). Checked on every request: the management must be ACCEPTED, nobody may be suspended, banned or deleted (else 403 account_not_managed), and the agency needs the endpoint’s permission on that account (else 403 permission_denied). Omit it to act as the key’s own account.",
      "schema": {
        "type": "string",
        "pattern": "^c[a-z0-9]{20,32}$"
      },
      "example": "cmh4v2q8k0003xy9z7w6v5u4t"
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "multipart/form-data": {
        "schema": {
          "type": "object",
          "properties": {
            "fileType": {
              "type": "string",
              "description": "What you are uploading.",
              "enum": [
                "image",
                "video",
                "audio"
              ]
            },
            "originalName": {
              "type": "string",
              "description": "The file’s name, stored as fileName.",
              "example": "beach-set-01.jpg"
            },
            "folderId": {
              "type": "string",
              "description": "Optional folder to file the item into."
            },
            "durationSeconds": {
              "type": "integer",
              "description": "Audio only — the voice message length in seconds (capped at 3600).",
              "maximum": 3600
            },
            "displayFile": {
              "type": "string",
              "contentMediaType": "application/octet-stream",
              "description": "Images only (required): the pre-compressed JPEG display copy."
            },
            "thumbnailFile": {
              "type": "string",
              "contentMediaType": "application/octet-stream",
              "description": "Images only (required): the JPEG thumbnail."
            },
            "file": {
              "type": "string",
              "contentMediaType": "application/octet-stream",
              "description": "Video/audio only (required): the media file. Audio ≤20MB; video effectively ≤~4MB here — use the TUS flow for anything bigger."
            }
          },
          "required": [
            "fileType",
            "originalName"
          ]
        },
        "examples": {
          "image": {
            "summary": "Image upload (display + thumbnail parts)",
            "value": {
              "fileType": "image",
              "originalName": "beach-set-01.jpg",
              "displayFile": "@photo.jpg",
              "thumbnailFile": "@photo-thumb.jpg"
            }
          },
          "audio": {
            "summary": "Voice message",
            "value": {
              "fileType": "audio",
              "originalName": "voice-note.ogg",
              "durationSeconds": 42,
              "file": "@voice-note.ogg"
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Uploaded. The item starts PENDING moderation (not included in this shape — poll the list with includePending=true, or wait for it to appear in the default list).",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-Dropfans-Account": {
          "description": "The id of the account this request acted on — the key’s own account, or the managed account named in the X-Dropfans-Account request header. Assert it when acting for several accounts.",
          "schema": {
            "type": "string"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Always true.",
                "example": true
              },
              "item": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The new vault item id.",
                    "example": "clxv1a2b30001item"
                  },
                  "fileName": {
                    "type": "string",
                    "description": "The `originalName` you sent.",
                    "example": "beach-set-01.jpg"
                  },
                  "filePath": {
                    "type": "string",
                    "description": "CDN URL of the stored display asset (images/audio) or the Stream playback URL (videos)."
                  },
                  "thumbnailPath": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Thumbnail URL. Null for audio."
                  },
                  "fileType": {
                    "type": "string",
                    "description": "Media kind, echoing the request.",
                    "enum": [
                      "image",
                      "video",
                      "audio"
                    ]
                  },
                  "fileSize": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Stored size in bytes.",
                    "example": 482113
                  },
                  "durationSeconds": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Voice-message length in seconds (audio only, when you sent it). Null otherwise."
                  },
                  "bunnyStreamId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Bunny Stream GUID (video uploads only)."
                  },
                  "createdAt": {
                    "type": "string",
                    "description": "Creation time.",
                    "format": "date-time"
                  }
                },
                "required": [
                  "id",
                  "fileName",
                  "filePath",
                  "fileType",
                  "createdAt"
                ]
              }
            },
            "required": [
              "success",
              "item"
            ]
          },
          "example": {
            "success": true,
            "item": {
              "id": "clxv1a2b30001item",
              "fileName": "beach-set-01.jpg",
              "filePath": "https://cdn.dropfans.io/valeria/vault/1721990000-ab12cd.jpg",
              "thumbnailPath": "https://cdn.dropfans.io/valeria/thumbnails/1721990000-ab12cd.jpg",
              "fileType": "image",
              "fileSize": 482113,
              "durationSeconds": null,
              "bunnyStreamId": null,
              "createdAt": "2026-08-01T10:15:00.000Z"
            }
          }
        }
      }
    },
    "400": {
      "description": "Either required form field is absent. Also: `fileType` is anything other than image, video or audio. Also: Image upload without both file parts. Also: fileType=video without a `file` part. Also: fileType=audio without a `file` part. Also: `X-Dropfans-Account` is not an account id. Also: Called under /v1/creators/{creatorId}/ with an `X-Dropfans-Account` naming another account.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message describing what went wrong.",
                "example": "Vault item not found"
              }
            },
            "required": [
              "error"
            ]
          },
          "example": {
            "error": "Missing required fields: fileType and originalName"
          }
        }
      }
    },
    "401": {
      "description": "Missing or invalid API key.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, api_category_disabled, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "Unauthorized",
            "code": "unauthorized"
          }
        }
      }
    },
    "403": {
      "description": "The creator in the path (or `X-Dropfans-Account`) is one this key cannot act for: no ACCEPTED management by your agency and not an account your app onboarded (or it no longer holds a key bound to your app), a key minted for one creator, or someone is suspended, banned or deleted. An unknown id gets the same answer. Also: For a managed creator: the agency lacks `canManageVault` on that account. Also: Your app has the Vault [API category](https://www.dropfans.io/developers/concepts/api-categories.md) switched off.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, api_category_disabled, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "This key cannot act for that account.",
            "code": "account_not_managed"
          }
        }
      }
    },
    "413": {
      "description": "Audio file over 20MB.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message describing what went wrong.",
                "example": "Vault item not found"
              }
            },
            "required": [
              "error"
            ]
          },
          "example": {
            "error": "Audio too large"
          }
        }
      }
    },
    "429": {
      "description": "Rate limit exceeded for the current minute or day window. Wait Retry-After seconds and retry.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "Retry-After": {
          "description": "Seconds to wait before retrying (sent with 429s).",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, api_category_disabled, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "Rate limit exceeded",
            "code": "rate_limited"
          }
        }
      }
    },
    "500": {
      "description": "Storage or moderation kickoff failed — retry later.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message describing what went wrong.",
                "example": "Vault item not found"
              }
            },
            "required": [
              "error"
            ]
          },
          "example": {
            "error": "Failed to upload file"
          }
        }
      }
    }
  },
  "x-codeSamples": [
    {
      "lang": "cURL",
      "label": "curl",
      "source": "curl -X POST \"https://www.dropfans.io/api/external/v1/vault\" \\\n  -H \"Authorization: Bearer $DROPFANS_API_KEY\" \\\n  -F \"fileType=image\" \\\n  -F \"originalName=beach-set-01.jpg\" \\\n  -F \"displayFile=@photo.jpg\" \\\n  -F \"thumbnailFile=@photo-thumb.jpg\""
    },
    {
      "lang": "JavaScript",
      "label": "Node",
      "source": "import { readFile } from 'node:fs/promises';\n\nconst form = new FormData();\nform.append('fileType', \"image\");\nform.append('originalName', \"beach-set-01.jpg\");\nform.append('displayFile', new Blob([await readFile('photo.jpg')]), 'photo.jpg');\nform.append('thumbnailFile', new Blob([await readFile('photo-thumb.jpg')]), 'photo-thumb.jpg');\n\nconst res = await fetch(`https://www.dropfans.io/api/external/v1/vault`, {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.DROPFANS_API_KEY}`,\n  },\n  body: form,\n});\nconsole.log(await res.json());"
    },
    {
      "lang": "Python",
      "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://www.dropfans.io/api/external/v1/vault\",\n    headers={\"Authorization\": f\"Bearer {os.environ['DROPFANS_API_KEY']}\"},\n    files={\n        \"displayFile\": open(\"photo.jpg\", \"rb\"),\n        \"thumbnailFile\": open(\"photo-thumb.jpg\", \"rb\"),\n    },\n    data={\n        \"fileType\": \"image\",\n        \"originalName\": \"beach-set-01.jpg\",\n    },\n)\nprint(res.json())"
    }
  ],
  "x-dropfans-docs": "https://www.dropfans.io/developers/reference/upload-vault-item",
  "x-dropfans-category": "vault",
  "x-dropfans-agency-permission": "canManageVault"
}
```

---

Previous: [List your vault items — the source of media for posts](https://www.dropfans.io/developers/reference/list-vault.md) · Next: [Delete (hide) a vault item](https://www.dropfans.io/developers/reference/delete-vault-item.md) · All pages: [llms.txt](https://www.dropfans.io/developers/llms.txt)
