Skip to main content
POST
/
api
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
assets
curl -X POST "https://api.metabind.ai/api/v1/organizations/org123/projects/proj456/assets" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "file=@/path/to/image.jpg" \
  -F 'metadata={"alt": "Product hero image"}' \
  -F 'tags=["hero", "product"]'
{
  "data": {
    "id": "asset789",
    "name": "image.jpg",
    "description": null,
    "type": "image/jpeg",
    "status": "active",
    "url": "https://cdn.metabind.ai/org123/proj456/assets/asset789/image.jpg",
    "size": 1536000,
    "metadata": {
      "width": 1920,
      "height": 1080,
      "format": "jpeg",
      "alt": "Product hero image"
    },
    "tags": ["hero", "product"],
    "createdAt": "2024-03-21T14:30:00Z",
    "updatedAt": "2024-03-21T14:30:00Z"
  }
}
Upload a new asset to the project. This endpoint accepts multipart/form-data for file uploads.
This endpoint uses multipart/form-data, not JSON. The file is sent as binary data.

Path Parameters

organizationId
string
required
The unique identifier of the organization
projectId
string
required
The unique identifier of the project

Request Body

file
file
required
The file to upload. Supported formats include images (JPEG, PNG, GIF, WebP, AVIF), videos (MP4, MOV, WebM), and documents (PDF).
metadata
string
JSON string containing metadata object. Will be parsed and stored with the asset.
{
  "alt": "Hero image description",
  "caption": "Photo by John Doe"
}
tags
string
JSON string array of tag IDs to associate with the asset.
["hero", "homepage", "featured"]

Response

Returns the created Asset object.
data
Asset
The newly created asset object with generated ID and CDN URL
curl -X POST "https://api.metabind.ai/api/v1/organizations/org123/projects/proj456/assets" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "file=@/path/to/image.jpg" \
  -F 'metadata={"alt": "Product hero image"}' \
  -F 'tags=["hero", "product"]'
{
  "data": {
    "id": "asset789",
    "name": "image.jpg",
    "description": null,
    "type": "image/jpeg",
    "status": "active",
    "url": "https://cdn.metabind.ai/org123/proj456/assets/asset789/image.jpg",
    "size": 1536000,
    "metadata": {
      "width": 1920,
      "height": 1080,
      "format": "jpeg",
      "alt": "Product hero image"
    },
    "tags": ["hero", "product"],
    "createdAt": "2024-03-21T14:30:00Z",
    "updatedAt": "2024-03-21T14:30:00Z"
  }
}