Skip to content

Resource Gallery Images

Manage gallery images for marketplace resources to showcase your content.

All gallery image endpoints are prefixed with /resources/:resourceId/gallery-images


POST /resources/:resourceId/gallery-images

Add an image to the resource gallery.

Authentication: Required (must be owner or contributor)

Content-Type: multipart/form-data

URL Parameters:

  • resourceId (string) - Resource ID

Form Data:

  • image (file) - Image file (PNG, JPG, WEBP)
  • caption (string, optional) - Image caption
  • altText (string, optional) - Alt text for accessibility

Response:

{
"id": "image-id",
"resourceId": "resource-id",
"imageUrl": "https://...",
"caption": "Screenshot of the mod in action",
"altText": "Mod interface screenshot",
"order": 0,
"createdAt": "2024-01-01T00:00:00Z"
}

GET /resources/:resourceId/gallery-images

Get all gallery images for a resource.

Authentication: Not required

URL Parameters:

  • resourceId (string) - Resource ID

Response:

{
"images": [
{
"id": "image-id",
"imageUrl": "https://...",
"thumbnailUrl": "https://...",
"caption": "Screenshot",
"altText": "Alt text",
"order": 0,
"createdAt": "2024-01-01T00:00:00Z"
}
]
}

GET /resources/:resourceId/gallery-images/:imageId

Get a specific gallery image.

Authentication: Not required

URL Parameters:

  • resourceId (string) - Resource ID
  • imageId (string) - Image ID

Response:

{
"id": "image-id",
"imageUrl": "https://...",
"caption": "Screenshot",
"altText": "Alt text",
"order": 0
}

PATCH /resources/:resourceId/gallery-images/:imageId

Update gallery image details (caption, alt text).

Authentication: Required (must be owner or contributor)

URL Parameters:

  • resourceId (string) - Resource ID
  • imageId (string) - Image ID

Request Body:

{
"caption": "Updated caption",
"altText": "Updated alt text"
}

POST /resources/:resourceId/gallery-images/:imageId/replace

Replace the image file while keeping the same gallery position and metadata.

Authentication: Required (must be owner or contributor)

Content-Type: multipart/form-data

URL Parameters:

  • resourceId (string) - Resource ID
  • imageId (string) - Image ID

Form Data:

  • image (file) - New image file

Response:

{
"id": "image-id",
"imageUrl": "https://new-url...",
"updatedAt": "2024-01-01T00:00:00Z"
}

PUT /resources/:resourceId/gallery-images/reorder

Reorder gallery images by specifying the new order.

Authentication: Required (must be owner or contributor)

URL Parameters:

  • resourceId (string) - Resource ID

Request Body:

{
"imageIds": ["image-id-1", "image-id-2", "image-id-3"]
}

Response:

{
"message": "Gallery images reordered successfully"
}

DELETE /resources/:resourceId/gallery-images/:imageId

Delete a gallery image.

Authentication: Required (must be owner or contributor)

URL Parameters:

  • resourceId (string) - Resource ID
  • imageId (string) - Image ID

Response:

{
"message": "Gallery image deleted successfully"
}