Content Enrichment API / Vision AI
Delete vision images
PageMore page actions
POST /v2/project/content/vision/deleteImages
Delete images this project submitted, by image ID.
Synchronous. A delete removes your access, not the picture or its analysis; other clients keep the image.
- Requires an org admin's or owner's user token; a project API key gets 403.
- 1 to 100 image IDs per request; one entry per ID, in request order.
Statusisdeletedornot_found; an ID you do not own reportsnot_found.- Idempotent: an already deleted image answers
deletedagain. - The image leaves
listImages,getImagesand yourgetEnrichedHotelgallery, and its pin is cleared. - Submitting the URL again restores it under the same image ID, unbilled.
- 404 means Vision AI is not enabled for your project.
Example request
curl -X POST 'https://api.ygo.ai/v2/project/content/vision/deleteImages' \
-H "Authorization: Bearer $YGO_API_KEY" \
-H "X-Project-ID: $YGO_PROJECT_ID" \
-H "Content-Type: application/json" \
-d '{
"ImageIDs": [
"0192fb20-1aa2-7def-9abc-1122334455aa",
"0192fb21-2bb3-7def-9abc-2233445566bb"
]
}'Authorization
Authorization: Bearer <key>
User token (user_...) of an org admin or owner. Project-scoped API keys (proj_...) are refused with 403.
Headers
X-Project-IDstring (uuid) requiredProject UUID. Required for all project-scoped endpoints.
Request body required
application/json object DeleteVisionImagesRequest
Request body for deleting images this project submitted, by image ID.
ImageIDsarray of string (uuid) requiredImage UUIDs returned by ingestVisionImages, between 1 and 100 per request. The response returns one entry per ID, in this order.
Example request: Delete two images you uploaded
{
"ImageIDs": [
"0192fb20-1aa2-7def-9abc-1122334455aa",
"0192fb21-2bb3-7def-9abc-2233445566bb"
]
}Example request: One of your images and one ID this project never submitted
{
"ImageIDs": [
"0192fb20-1aa2-7def-9abc-1122334455aa",
"0192fb99-9ff9-7def-9abc-999999999999"
]
}Responses
200 OK
One entry per requested image ID, in request order. A batch in which every ID answers not_found is still a 200.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object DeleteVisionImagesResponse
Standard v2 envelope. Data is an object carrying the per-image results; there is no pagination on this endpoint.
Dataobject DeleteVisionImagesResult1 field
Imagesarray of object DeletedVisionImageState requiredOne entry per requested image ID, in request order.
2 fields
ImageIDstring (uuid) requiredEchoes the requested image ID.
Statusstring requireddeleted: this project's image is now deleted, or already was.not_found: the ID is unknown, belongs to another client or is not a Vision AI image, and these cases are indistinguishable.
Example response: Both images were this project's and are now deleted
{
"Data": {
"Images": [
{
"ImageID": "0192fb20-1aa2-7def-9abc-1122334455aa",
"Status": "deleted"
},
{
"ImageID": "0192fb21-2bb3-7def-9abc-2233445566bb",
"Status": "deleted"
}
]
}
}Example response: One deleted, one ID this project does not own
{
"Data": {
"Images": [
{
"ImageID": "0192fb20-1aa2-7def-9abc-1122334455aa",
"Status": "deleted"
},
{
"ImageID": "0192fb99-9ff9-7def-9abc-999999999999",
"Status": "not_found"
}
]
}
}Example response: The same call again: an already-deleted image still answers deleted
{
"Data": {
"Images": [
{
"ImageID": "0192fb20-1aa2-7def-9abc-1122334455aa",
"Status": "deleted"
}
]
}
}400 Bad Request
Bad Request: the request body or an image ID is invalid.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation. Per-entry errors carry the entry's position, for example ImageIDs[2].
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values; keys are PascalCase and depend on Code. Optional.
Example response: No image IDs provided
{
"Error": {
"Code": "VALIDATION_ERROR",
"Message": "Validation failed",
"Fields": [
{
"Field": "ImageIDs",
"Message": "ImageIDs must contain at least one image id"
}
]
}
}Example response: More than 100 image IDs in one request
{
"Error": {
"Code": "VALIDATION_ERROR",
"Message": "Validation failed",
"Fields": [
{
"Field": "ImageIDs",
"Message": "ImageIDs cannot exceed 100 entries"
}
]
}
}Example response: An entry is not a valid UUID
{
"Error": {
"Code": "VALIDATION_ERROR",
"Message": "Validation failed",
"Fields": [
{
"Field": "ImageIDs[2]",
"Message": "ImageID must be a valid UUID"
}
]
}
}401 Unauthorized
Unauthorized: the user token is missing or invalid.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation. Per-entry errors carry the entry's position, for example ImageIDs[2].
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values; keys are PascalCase and depend on Code. Optional.
Example response: Invalid API key
{
"Error": {
"Code": "UNAUTHORIZED",
"Message": "Invalid API key"
}
}403 Forbidden
Forbidden: the token is a project API key, its user is below org admin, it may not act on this project, or it lacks the content.catalog:write permission (INSUFFICIENT_SCOPE).
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation. Per-entry errors carry the entry's position, for example ImageIDs[2].
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values; keys are PascalCase and depend on Code. Optional.
Example response: Missing required scope
{
"Error": {
"Code": "INSUFFICIENT_SCOPE",
"Message": "token lacks scope content.catalog:write"
}
}Example response: Project access required
{
"Error": {
"Code": "FORBIDDEN",
"Message": "Project access required"
}
}Example response: A project (proj_) token or a user below org admin, the most common refusal
{
"Error": {
"Code": "FORBIDDEN",
"Message": "Deleting images requires a user token with the org admin role or higher"
}
}404 Not Found
Not Found: Vision AI is not enabled for your project, or the project does not exist. An unknown image ID is not a 404; it is reported per image as not_found.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation. Per-entry errors carry the entry's position, for example ImageIDs[2].
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values; keys are PascalCase and depend on Code. Optional.
Example response: Project or resource not found
{
"Error": {
"Code": "NOT_FOUND",
"Message": "Not found"
}
}429 Too Many Requests
Too Many Requests: the rate limit was exceeded. Retry-After carries the number of seconds to wait before retrying.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Retry-AfterintegerNumber of seconds to wait before retrying the request. Present on 429 responses.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation. Per-entry errors carry the entry's position, for example ImageIDs[2].
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values; keys are PascalCase and depend on Code. Optional.
Example response: Limit exceeded
{
"Error": {
"Code": "RATE_LIMIT_EXCEEDED",
"Message": "Rate limit exceeded. Retry after the number of seconds in the Retry-After header."
}
}500 Internal Server Error
Internal Server Error: unexpected server error. Quote the X-Trace-ID response header when contacting support.
Headers
X-Trace-IDstringRequest trace ID for debugging (OpenTelemetry). Include this ID when contacting support about specific requests.
Body
application/json object ErrorResponse
Standard v2 error response wrapper.
Errorobject ErrorDetail requiredError detail containing a machine-readable code and human-readable message.
3 fields
Codestring requiredMachine-readable error code for programmatic handling.
Messagestring requiredHuman-readable error message.
Fieldsarray of object FieldErrorField-level validation errors. Only present for VALIDATION_ERROR responses.
4 fields
Fieldstring requiredName of the field that failed validation. Per-entry errors carry the entry's position, for example ImageIDs[2].
Messagestring requiredHuman-readable validation error message for this field.
CodestringMachine-readable reason the field failed validation. Optional; clients should fall back to Message when it is absent or unrecognized.
Paramsmap of string to anyMachine-readable values the message is built from, such as limits or allowed values; keys are PascalCase and depend on Code. Optional.
Example response: Internal server error
{
"Error": {
"Code": "INTERNAL_ERROR",
"Message": "Failed to delete images"
}
}