Upload Plan Asset (v1)
Upload plan image asset.
Method & Path
POST /v1/admin/plans/assets
Description
Uploads an image asset for a subscription plan (e.g., plan icon or banner).
Authentication
Required: Admin authentication with plans.manage permission.
Headers
Authorization: Bearer <admin_token>
Content-Type: multipart/form-data
Request Body (Form Data)
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Image file to upload |
planId | string | Yes | Plan ID |
locale | string | Yes | Locale code |
variant | string | No | Asset variant (e.g., "icon", "banner") |
Response 201 Created
{
"asset": {
"url": "https://example.com/plan-asset.png",
"planId": "507f1f77bcf86cd799439011",
"locale": "en"
}
}
Common Errors
- 401 Unauthorized: Missing or invalid admin authentication token
- 403 Forbidden: Insufficient permissions
- 400 Bad Request: Missing file or invalid request
- 422 Unprocessable Entity: Validation errors
- 500 Internal Server Error: Server error