← Documentation home
POST/hyax-api/v1/media/upload-from-url

Upload image from URL

Fetches an image from a URL (http/https or a `data:image/*;base64,…` string) and stores it in the team's CDN. Returns the public CDN URL and file metadata. Storage plan limits apply. Use the returned `url` in `posts_update.imageUrl`, `PATCH /posts/:id/featured-image`, or any other field that accepts an image URL.

Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.

Request body

FieldRequiredDescription
urlYesImage URL to fetch — http/https or `data:image/*;base64,…`
typeNo`Image` (default) | `Post` | `Product` | `Tmp` — storage classification

Request examples

Same request in cURL, Node.js (fetch), and PHP (ext-curl).

curl -X POST 'https://platform.hyax.com/hyax-api/v1/media/upload-from-url' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://example.com/photo.jpg",
    "type": "Image"
  }'

Example response

Shape varies by data; values are illustrative.

{
  "success": true,
  "data": {
    "id": "clx…",
    "url": "https://cdn.hyax.com/team_id/images/photo.jpg",
    "mimeType": "image/jpeg",
    "size": 204800,
    "type": "Image"
  }
}