Skip to main content
PATCH
/
v1
/
posts
/
{id}
/
upload-image
Upload an image to a post
curl --request PATCH \
  --url https://api.yalg.ai/v1/posts/{id}/upload-image \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: <api-key>' \
  --form image='@example-file'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "content": "Post content...",
  "imageUrl": "/uploads/images/1640123456789-example.jpg",
  "videoUrl": null,
  "authorId": "987fcdeb-51a2-43d7-8f9e-123456789abc",
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:35:00Z"
}

Authorizations

x-api-key
string
header
default:yalg_live_your_api_key
required

YALG Developer API key. Send it in the x-api-key header from a server-side environment only.

Path Parameters

id
string
required

UUID of the post

Example:

"123e4567-e89b-12d3-a456-426614174000"

Body

multipart/form-data
image
file
required

Image file (jpg, png, gif, etc.)

Response

Image uploaded successfully