Replace a single image (PUT /imgs/{item_id})
This endpoint allows updating the metadata of a specific image using its unique identifier (item_id).
Parameters
In this case, theitem_id, which is the unique identifier of the image to be updated, must be included in the URL of the endpoint.
The other parameters that can be sent as query parameters are:
| Parameter | Type | Required | Description |
|---|---|---|---|
wait | Boolean | No | Enables ‘Synchronous’ mode. When true, waits until operation completes (default: false) |
urgent | Boolean | No | Enqueue the operation associated at head of operation’s queue |
strict | Boolean | No | Enables ‘Strict’ mode. When true, fails if image ID doesn’t exist. When false, ignores missing IDs (default: false) |
| Field | Type | Required | Description |
|---|---|---|---|
src | String | Yes | URL of the image (used as source for the AI) |
url_img_watermark | String | No | URL of the watermarked image |
url_img_thumbnail | String | No | URL of the thumbnail image |
title | String | No | Title of the image |
headline | String | No | Short text describing the image |
caption | String | No | Long text describing the image |
alt_text | String | No | Alternative text for accessibility |
ai_generated | Boolean | No | Indicates if image was generated by AI |
model_release | Boolean | No | Whether model release is available |
property_release | Boolean | No | Whether property release is available |
nsfw | Boolean | No | Whether content is not safe for work |
status | String | No | Current status: Active, Withdrawn, Reserved, RDA Only |
date | String | No | Date of image creation (YYYY-MM-DD format) |
location | String | No | Detailed location description |
city | String | No | City name |
country | String | No | Country name |
event | String | No | Event name |
author | String | No | Creator name |
provider | String | No | Provider identifier |
shot | String | No | Type of photography shot |
scene | String | No | Scene description |
technique | String | No | Technique used in creation |
medium | String | No | Medium used in creation |
keywords | Array | No | Keywords describing the image |
categories | Array | No | General categories |
collections | Array | No | Collections the image belongs to |
Request Example
Responses
Updating an image internally triggers an operation whose status can be queried. Accordingly, the endpoint returns all information associated with that operation, enabling the client to identify the generated operation ID and check its status thereafter.Image was updated successfully (Response Code: 200)
If the image has been updated successfully, all information related to the operation created to manage the image update will be returned, for example:Image update accepted but pending (Response Code: 202)
If the request has simply been accepted but is pending asynchronous execution, an object with the ID of the operation created to manage the image update will be returned, for example:Error in data validation (Response Code: 422)
If some error has occurred during the data validation stage, this will be shown with an error message indicating the reason for the failure, for example:Replace multiple images (PUT /imgs)
This endpoint allows you to replace data for multiple images at once. It’s useful for efficiently updating large quantities of images.
Parameters
This endpoint maintains the sameQuery Parameters as the previous endpoint, but also allows for a request body containing the data of the images to be updated.
| Parameter | Type | Required | Description |
|---|---|---|---|
wait | Boolean | No | Enables ‘Synchronous’ mode. When true, waits until operation completes (default: false) |
strict | Boolean | No | Enables ‘Strict’ mode. When true, fails if image ID doesn’t exist. When false, ignores missing IDs (default: false) |
urgent | Boolean | No | Enables ‘Faster’ mode. When true, operation is prioritized in queue (default: false) |
lang | String | No | Language for tags (default: “en”, possible values: “en”, “es”, “fr”, “de”, “pt”, “ru”) |
id field with the identifier of the image to be updated, along with the fields to be modified. For example:
| Field | Type | Required | Description |
|---|---|---|---|
id | String/Number | Yes | Unique identifier of the image to update |
| Other fields | Various | No | Any field from the image schema that needs to be updated |
Request Example
Here is an example of how to use the Wesog Search API for updating multiple images:Responses
Images were updated successfully (Response Code: 200)
Similar to the scenario where only a single image is requested to be updated to the Wesog service, in the case of updating multiple images, if they were processed and updated within the system (or were processed and discarded due to some type of internal error), a response will be provided with a message including all relevant information related to the image update process.Images update accepted but pending (Response Code: 202)
The process of updating a set of images usually requires more time than updating a single image, depending on the amount of data sent to the service. For this reason, the type of response that will be shown predominantly in a short period of time after making the update request will be this one. As seen previously when dealing with the process of updating a single image, the operation ID, total number of images being processed, and a secondary message providing more information about the operation’s progress are sent, if necessary.Error in validation data (Response Code: 422)
This error occurs just like in the case of the individual image, when the format of the sent message does not match the expected format, described in the request section. This happens mainly when necessary fields such asid are not included.