> ## 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/drops/{id}/previews — Attach baked blur previews to a drop

> Uploads pre-blurred ("baked") JPEG teasers for a drop's media, so the checkout page shows the exact same blur your app showed the buyer elsewhere.

- Source: https://www.dropfans.io/developers/reference/attach-drop-previews
- Section: API reference
- OpenAPI: https://www.dropfans.io/developers/openapi.json

Uploads pre-blurred ("baked") JPEG teasers for a drop's media, so the checkout page shows the exact same blur your app showed the buyer elsewhere.

The body is `multipart/form-data` with one part per media item, named by vault item id: `previewBlob_<vaultItemId>` (the baked JPEG) and optionally `blurMeta_<vaultItemId>` (a descriptor like `"partial"`, `"pixelated:59"` or `"full"`). Without previews, paid media falls back to a generic gaussian blur.

> [!WARNING] Best-effort — skipped items fail silently
> Parts that are missing, not `image/jpeg`, over 8MB, or that hit a storage error are **skipped without an error**. The only signal is the `updated` count — compare it to how many parts you sent. Repeatable: re-sending overwrites the stored preview.

## Authentication

`Authorization: Bearer dpfn_...` — an API key generated in the creator's dashboard (Vault → API Connect). One key = one creator. Missing or invalid keys return 401 `{"error":"Unauthorized","code":"unauthorized"}`.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The product (drop) id. |

## Request body (multipart/form-data)

Field names embed the vault item id — one previewBlob per media item you want a preview on.

| Field | Type | Required | Description |
|---|---|---|---|
| `previewBlob_<vaultItemId>` | file |  | The baked JPEG teaser for that media item. Must be image/jpeg, ≤8MB. |
| `blurMeta_<vaultItemId>` | string |  | Optional blur descriptor recorded alongside: "full", "partial" or "pixelated:<intensity>". |

Example — Baked previews for two media items:

```json
{
  "previewBlob_clxv1a2b30001item": "@preview-1.jpg",
  "blurMeta_clxv1a2b30001item": "partial",
  "previewBlob_clxv1a2b30002item": "@preview-2.jpg",
  "blurMeta_clxv1a2b30002item": "pixelated:59"
}
```

## Responses

### 200

`updated` = how many previews were actually stored. If it is lower than the number of parts you sent, the difference was silently skipped.

| Field | Type | Required | Description |
|---|---|---|---|
| `success` | boolean | yes | Always true. |
| `updated` | integer | yes | Previews stored on this call. |

```json
{
  "success": true,
  "updated": 2
}
```

## Errors

| Status | Body | When |
|---|---|---|
| 401 | `{"error":"Unauthorized","code":"unauthorized"}` | Missing or invalid API key. |
| 403 | `{"error":"You do not own this drop"}` | The drop belongs to another creator. |
| 404 | `{"error":"Drop not found"}` | No such drop. |
| 500 | `{"error":"Failed to attach previews"}` | Unexpected failure — retry later. |

## 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/drops/$PRODUCT_ID/previews" \
  -H "Authorization: Bearer $DROPFANS_API_KEY" \
  -F "previewBlob_clxv1a2b30001item=@preview-1.jpg;type=image/jpeg" \
  -F "blurMeta_clxv1a2b30001item=partial" \
  -F "previewBlob_clxv1a2b30002item=@preview-2.jpg;type=image/jpeg" \
  -F "blurMeta_clxv1a2b30002item=pixelated:59"
```

### Node

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

const form = new FormData();
form.append(
  'previewBlob_clxv1a2b30001item',
  new Blob([await readFile('preview-1.jpg')], { type: 'image/jpeg' }),
  'preview-1.jpg',
);
form.append('blurMeta_clxv1a2b30001item', 'partial');

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

### Python

```python
import os, requests

res = requests.post(
    f"https://www.dropfans.io/api/external/drops/{product_id}/previews",
    headers={"Authorization": f"Bearer {os.environ['DROPFANS_API_KEY']}"},
    files={
        "previewBlob_clxv1a2b30001item": ("preview-1.jpg", open("preview-1.jpg", "rb"), "image/jpeg"),
    },
    data={"blurMeta_clxv1a2b30001item": "partial"},
)
print(res.json())  # { "success": true, "updated": 1 }
```

## OpenAPI

```json
{
  "method": "POST",
  "path": "/api/external/drops/{id}/previews",
  "operationId": "attachDropPreviews",
  "tags": [
    "drops"
  ],
  "summary": "Attach baked blur previews to a drop",
  "description": "Uploads pre-blurred (\"baked\") JPEG teasers for a drop's media, so the checkout page shows the exact same blur your app showed the buyer elsewhere.\n\nThe body is `multipart/form-data` with one part per media item, named by vault item id: `previewBlob_<vaultItemId>` (the baked JPEG) and optionally `blurMeta_<vaultItemId>` (a descriptor like `\"partial\"`, `\"pixelated:59\"` or `\"full\"`). Without previews, paid media falls back to a generic gaussian blur.\n\n> [!WARNING] Best-effort — skipped items fail silently\n> Parts that are missing, not `image/jpeg`, over 8MB, or that hit a storage error are **skipped without an error**. The only signal is the `updated` count — compare it to how many parts you sent. Repeatable: re-sending overwrites the stored preview.",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The product (drop) id.",
      "schema": {
        "type": "string"
      },
      "example": "clxdr0p000001prod"
    }
  ],
  "requestBody": {
    "required": true,
    "description": "Field names embed the vault item id — one previewBlob per media item you want a preview on.",
    "content": {
      "multipart/form-data": {
        "schema": {
          "type": "object",
          "properties": {
            "previewBlob_<vaultItemId>": {
              "type": "string",
              "contentMediaType": "application/octet-stream",
              "description": "The baked JPEG teaser for that media item. Must be image/jpeg, ≤8MB."
            },
            "blurMeta_<vaultItemId>": {
              "type": "string",
              "description": "Optional blur descriptor recorded alongside: \"full\", \"partial\" or \"pixelated:<intensity>\".",
              "example": "pixelated:59"
            }
          }
        },
        "examples": {
          "previews": {
            "summary": "Baked previews for two media items",
            "value": {
              "previewBlob_clxv1a2b30001item": "@preview-1.jpg",
              "blurMeta_clxv1a2b30001item": "partial",
              "previewBlob_clxv1a2b30002item": "@preview-2.jpg",
              "blurMeta_clxv1a2b30002item": "pixelated:59"
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "`updated` = how many previews were actually stored. If it is lower than the number of parts you sent, the difference was silently skipped.",
      "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": {
              "success": {
                "type": "boolean",
                "description": "Always true.",
                "example": true
              },
              "updated": {
                "type": "integer",
                "description": "Previews stored on this call.",
                "example": 2
              }
            },
            "required": [
              "success",
              "updated"
            ]
          },
          "example": {
            "success": true,
            "updated": 2
          }
        }
      }
    },
    "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, rate_limited, username_required.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "Unauthorized",
            "code": "unauthorized"
          }
        }
      }
    },
    "403": {
      "description": "The drop belongs to another creator.",
      "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": "You do not own this drop"
          }
        }
      }
    },
    "404": {
      "description": "No such drop.",
      "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": "Drop not found"
          }
        }
      }
    },
    "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, rate_limited, username_required.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "Rate limit exceeded",
            "code": "rate_limited"
          }
        }
      }
    },
    "500": {
      "description": "Unexpected failure — 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 attach previews"
          }
        }
      }
    }
  },
  "x-codeSamples": [
    {
      "lang": "cURL",
      "label": "curl",
      "source": "curl -X POST \"https://www.dropfans.io/api/external/drops/$PRODUCT_ID/previews\" \\\n  -H \"Authorization: Bearer $DROPFANS_API_KEY\" \\\n  -F \"previewBlob_clxv1a2b30001item=@preview-1.jpg;type=image/jpeg\" \\\n  -F \"blurMeta_clxv1a2b30001item=partial\" \\\n  -F \"previewBlob_clxv1a2b30002item=@preview-2.jpg;type=image/jpeg\" \\\n  -F \"blurMeta_clxv1a2b30002item=pixelated:59\""
    },
    {
      "lang": "JavaScript",
      "label": "Node",
      "source": "import { readFile } from 'node:fs/promises';\n\nconst form = new FormData();\nform.append(\n  'previewBlob_clxv1a2b30001item',\n  new Blob([await readFile('preview-1.jpg')], { type: 'image/jpeg' }),\n  'preview-1.jpg',\n);\nform.append('blurMeta_clxv1a2b30001item', 'partial');\n\nconst res = await fetch(\n  `https://www.dropfans.io/api/external/drops/${productId}/previews`,\n  {\n    method: 'POST',\n    headers: { Authorization: `Bearer ${process.env.DROPFANS_API_KEY}` },\n    body: form,\n  },\n);\nconsole.log(await res.json()); // { success: true, updated: 1 }"
    },
    {
      "lang": "Python",
      "source": "import os, requests\n\nres = requests.post(\n    f\"https://www.dropfans.io/api/external/drops/{product_id}/previews\",\n    headers={\"Authorization\": f\"Bearer {os.environ['DROPFANS_API_KEY']}\"},\n    files={\n        \"previewBlob_clxv1a2b30001item\": (\"preview-1.jpg\", open(\"preview-1.jpg\", \"rb\"), \"image/jpeg\"),\n    },\n    data={\"blurMeta_clxv1a2b30001item\": \"partial\"},\n)\nprint(res.json())  # { \"success\": true, \"updated\": 1 }"
    }
  ],
  "x-dropfans-docs": "https://www.dropfans.io/developers/reference/attach-drop-previews"
}
```

---

Previous: [Read back a drop](https://www.dropfans.io/developers/reference/get-drop.md) · Next: [Check which drops sold (batch)](https://www.dropfans.io/developers/reference/check-drop-status.md) · All pages: [llms.txt](https://www.dropfans.io/developers/llms.txt)
