Skip to main content
PATCH
/
imgs
/
{image_id}
Modify 1 image
curl --request PATCH \
  --url https://api.wesog.com/imgs/{image_id} \
  --header 'API-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "src": "https://cdn.example.com/image/source.jpg",
  "src_path": "/data/images/source.jpg",
  "url_img_watermark": "https://cdn.example.com/image/wm.jpg",
  "url_img_thumbnail": "https://cdn.example.com/image/thumb.jpg",
  "title": "image123",
  "headline": "Sunset over the Hudson River",
  "caption": "A vibrant orange sunset reflecting on the river with the city skyline in silhouette.",
  "alt_text": "<string>",
  "ai_generated": true,
  "model_release": true,
  "property_release": true,
  "nsfw": true,
  "status": "Active",
  "date": "2024-10-19",
  "location": "123 Main St, near Central Park",
  "city": "New York",
  "country": "United States",
  "event": "Oscar awards 2024",
  "author": "Jane Doe",
  "provider": "Acme Inc.",
  "shot": "Portrait",
  "scene": "Town square",
  "technique": "Drawing",
  "medium": "Oil on canvas",
  "keywords": [
    "Tree",
    "Dog",
    "Ball",
    "Water"
  ],
  "categories": [
    "Sport",
    "Fashion",
    "Politics"
  ],
  "collections": [
    "Steet pics",
    "Exclusive"
  ]
}
'
import requests

url = "https://api.wesog.com/imgs/{image_id}"

payload = {
"src": "https://cdn.example.com/image/source.jpg",
"src_path": "/data/images/source.jpg",
"url_img_watermark": "https://cdn.example.com/image/wm.jpg",
"url_img_thumbnail": "https://cdn.example.com/image/thumb.jpg",
"title": "image123",
"headline": "Sunset over the Hudson River",
"caption": "A vibrant orange sunset reflecting on the river with the city skyline in silhouette.",
"alt_text": "<string>",
"ai_generated": True,
"model_release": True,
"property_release": True,
"nsfw": True,
"status": "Active",
"date": "2024-10-19",
"location": "123 Main St, near Central Park",
"city": "New York",
"country": "United States",
"event": "Oscar awards 2024",
"author": "Jane Doe",
"provider": "Acme Inc.",
"shot": "Portrait",
"scene": "Town square",
"technique": "Drawing",
"medium": "Oil on canvas",
"keywords": ["Tree", "Dog", "Ball", "Water"],
"categories": ["Sport", "Fashion", "Politics"],
"collections": ["Steet pics", "Exclusive"]
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
src: 'https://cdn.example.com/image/source.jpg',
src_path: '/data/images/source.jpg',
url_img_watermark: 'https://cdn.example.com/image/wm.jpg',
url_img_thumbnail: 'https://cdn.example.com/image/thumb.jpg',
title: 'image123',
headline: 'Sunset over the Hudson River',
caption: 'A vibrant orange sunset reflecting on the river with the city skyline in silhouette.',
alt_text: '<string>',
ai_generated: true,
model_release: true,
property_release: true,
nsfw: true,
status: 'Active',
date: '2024-10-19',
location: '123 Main St, near Central Park',
city: 'New York',
country: 'United States',
event: 'Oscar awards 2024',
author: 'Jane Doe',
provider: 'Acme Inc.',
shot: 'Portrait',
scene: 'Town square',
technique: 'Drawing',
medium: 'Oil on canvas',
keywords: ['Tree', 'Dog', 'Ball', 'Water'],
categories: ['Sport', 'Fashion', 'Politics'],
collections: ['Steet pics', 'Exclusive']
})
};

fetch('https://api.wesog.com/imgs/{image_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wesog.com/imgs/{image_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'src' => 'https://cdn.example.com/image/source.jpg',
'src_path' => '/data/images/source.jpg',
'url_img_watermark' => 'https://cdn.example.com/image/wm.jpg',
'url_img_thumbnail' => 'https://cdn.example.com/image/thumb.jpg',
'title' => 'image123',
'headline' => 'Sunset over the Hudson River',
'caption' => 'A vibrant orange sunset reflecting on the river with the city skyline in silhouette.',
'alt_text' => '<string>',
'ai_generated' => true,
'model_release' => true,
'property_release' => true,
'nsfw' => true,
'status' => 'Active',
'date' => '2024-10-19',
'location' => '123 Main St, near Central Park',
'city' => 'New York',
'country' => 'United States',
'event' => 'Oscar awards 2024',
'author' => 'Jane Doe',
'provider' => 'Acme Inc.',
'shot' => 'Portrait',
'scene' => 'Town square',
'technique' => 'Drawing',
'medium' => 'Oil on canvas',
'keywords' => [
'Tree',
'Dog',
'Ball',
'Water'
],
'categories' => [
'Sport',
'Fashion',
'Politics'
],
'collections' => [
'Steet pics',
'Exclusive'
]
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.wesog.com/imgs/{image_id}"

payload := strings.NewReader("{\n \"src\": \"https://cdn.example.com/image/source.jpg\",\n \"src_path\": \"/data/images/source.jpg\",\n \"url_img_watermark\": \"https://cdn.example.com/image/wm.jpg\",\n \"url_img_thumbnail\": \"https://cdn.example.com/image/thumb.jpg\",\n \"title\": \"image123\",\n \"headline\": \"Sunset over the Hudson River\",\n \"caption\": \"A vibrant orange sunset reflecting on the river with the city skyline in silhouette.\",\n \"alt_text\": \"<string>\",\n \"ai_generated\": true,\n \"model_release\": true,\n \"property_release\": true,\n \"nsfw\": true,\n \"status\": \"Active\",\n \"date\": \"2024-10-19\",\n \"location\": \"123 Main St, near Central Park\",\n \"city\": \"New York\",\n \"country\": \"United States\",\n \"event\": \"Oscar awards 2024\",\n \"author\": \"Jane Doe\",\n \"provider\": \"Acme Inc.\",\n \"shot\": \"Portrait\",\n \"scene\": \"Town square\",\n \"technique\": \"Drawing\",\n \"medium\": \"Oil on canvas\",\n \"keywords\": [\n \"Tree\",\n \"Dog\",\n \"Ball\",\n \"Water\"\n ],\n \"categories\": [\n \"Sport\",\n \"Fashion\",\n \"Politics\"\n ],\n \"collections\": [\n \"Steet pics\",\n \"Exclusive\"\n ]\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.wesog.com/imgs/{image_id}")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"src\": \"https://cdn.example.com/image/source.jpg\",\n \"src_path\": \"/data/images/source.jpg\",\n \"url_img_watermark\": \"https://cdn.example.com/image/wm.jpg\",\n \"url_img_thumbnail\": \"https://cdn.example.com/image/thumb.jpg\",\n \"title\": \"image123\",\n \"headline\": \"Sunset over the Hudson River\",\n \"caption\": \"A vibrant orange sunset reflecting on the river with the city skyline in silhouette.\",\n \"alt_text\": \"<string>\",\n \"ai_generated\": true,\n \"model_release\": true,\n \"property_release\": true,\n \"nsfw\": true,\n \"status\": \"Active\",\n \"date\": \"2024-10-19\",\n \"location\": \"123 Main St, near Central Park\",\n \"city\": \"New York\",\n \"country\": \"United States\",\n \"event\": \"Oscar awards 2024\",\n \"author\": \"Jane Doe\",\n \"provider\": \"Acme Inc.\",\n \"shot\": \"Portrait\",\n \"scene\": \"Town square\",\n \"technique\": \"Drawing\",\n \"medium\": \"Oil on canvas\",\n \"keywords\": [\n \"Tree\",\n \"Dog\",\n \"Ball\",\n \"Water\"\n ],\n \"categories\": [\n \"Sport\",\n \"Fashion\",\n \"Politics\"\n ],\n \"collections\": [\n \"Steet pics\",\n \"Exclusive\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.wesog.com/imgs/{image_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"src\": \"https://cdn.example.com/image/source.jpg\",\n \"src_path\": \"/data/images/source.jpg\",\n \"url_img_watermark\": \"https://cdn.example.com/image/wm.jpg\",\n \"url_img_thumbnail\": \"https://cdn.example.com/image/thumb.jpg\",\n \"title\": \"image123\",\n \"headline\": \"Sunset over the Hudson River\",\n \"caption\": \"A vibrant orange sunset reflecting on the river with the city skyline in silhouette.\",\n \"alt_text\": \"<string>\",\n \"ai_generated\": true,\n \"model_release\": true,\n \"property_release\": true,\n \"nsfw\": true,\n \"status\": \"Active\",\n \"date\": \"2024-10-19\",\n \"location\": \"123 Main St, near Central Park\",\n \"city\": \"New York\",\n \"country\": \"United States\",\n \"event\": \"Oscar awards 2024\",\n \"author\": \"Jane Doe\",\n \"provider\": \"Acme Inc.\",\n \"shot\": \"Portrait\",\n \"scene\": \"Town square\",\n \"technique\": \"Drawing\",\n \"medium\": \"Oil on canvas\",\n \"keywords\": [\n \"Tree\",\n \"Dog\",\n \"Ball\",\n \"Water\"\n ],\n \"categories\": [\n \"Sport\",\n \"Fashion\",\n \"Politics\"\n ],\n \"collections\": [\n \"Steet pics\",\n \"Exclusive\"\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "num_total": 123,
  "num_good": 123,
  "num_bad": 123,
  "is_started": true,
  "is_finished": true,
  "all_good": true,
  "do_wait": true,
  "do_urgent": true,
  "do_strict": true,
  "idle_ms": 123,
  "exec_ms": 123,
  "created_at": "<string>",
  "started_at": "<string>",
  "finished_at": "<string>",
  "errors": [
    {
      "id": 123,
      "msg": "<string>"
    }
  ]
}
{
"operation_id": 123,
"n_total": 123,
"msg": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

API-Key
string
header
required

Query Parameters

wait
boolean
default:false

Wait for completion?

urgent
boolean
default:false

Enqueue at head of queue if True

strict
boolean
default:false

Use strict mode if True

lang
string
default:es

en|es|pt|fr|ru

Body

application/json
src
string | null

Url of the image in high or medium resolution (used as source for the AI). Alternative to src_path; provide exactly one of the two.

Example:

"https://cdn.example.com/image/source.jpg"

src_path
string | null

Local filesystem path of the image (used as source for the AI). Alternative to src; provide exactly one of the two.

Example:

"/data/images/source.jpg"

url_img_watermark
string | null

URL of the watermarked image.

Example:

"https://cdn.example.com/image/wm.jpg"

url_img_thumbnail
string | null

URL of the thumbnail image.

Example:

"https://cdn.example.com/image/thumb.jpg"

title
string | null

A shorthand reference for the image.

Example:

"image123"

headline
string | null

Short text describing the image.

Example:

"Sunset over the Hudson River"

caption
string | null

Long text describing the image.

Example:

"A vibrant orange sunset reflecting on the river with the city skyline in silhouette."

alt_text
string | null

Text describing the visual appearance of an image (Accessibility).

ai_generated
boolean | null

Image generated by Artificial Intelligence.

model_release
boolean | null

image with model release.

property_release
boolean | null

image with property release.

nsfw
boolean | null

Image Not Safe For Work.

status
string | null

Current status of the image.

Example:

"Active"

date
string | null

Date of the image creation in year-month-day format. Capture date for photographies.

Example:

"2024-10-19"

location
string | null

A detailed description of the location, complementing the specified country and city with additional details such as street address or notable landmarks.

Example:

"123 Main St, near Central Park"

city
string | null

Name of the country.

Example:

"New York"

country
string | null

Name of the country.

Example:

"United States"

event
string | null

Related event

Example:

"Oscar awards 2024"

author
string | null

The name of the individual or entity responsible for creating the image, such as a photographer or painter.

Example:

"Jane Doe"

provider
string | null

The identifier of the provider, which can be either a unique numeric ID or a descriptive name.

Example:

"Acme Inc."

shot
string | null

Type of photography shot.

Example:

"Portrait"

scene
string | null

Spot, place, visual location

Example:

"Town square"

technique
string | null

The specific method or process used in creating the artwork, reflecting the artist's unique approach or the traditional methods tied to certain mediums.

Example:

"Drawing"

medium
string | null

The material or substance used in the creation of the artwork or object. This field corresponds to various artistic mediums like oils, acrylics, or digital formats.

Example:

"Oil on canvas"

keywords
string[] | null

Specific tags describing the image

Example:
["Tree", "Dog", "Ball", "Water"]
categories
string[] | null

General categories of the image

Example:
["Sport", "Fashion", "Politics"]
collections
string[] | null

Collections that the image belongs to

Example:
["Steet pics", "Exclusive"]

Response

image successfully modified

Output of:

  • a synchronous (blocking) operation. POST /imgs?wait=true
  • operation status. GET ops/<op_id>
method
enum<string>
required

Operation type based on the HTTP method.

Available options:
add,
upd,
del,
multiple
resource
enum<string>
required

Resource type involved in the operation.

Available options:
video,
image,
celebs
num_total
integer
required

Total of elements.

num_good
integer
required

Number of correctly processed elements.

num_bad
integer
required

Number of failed processed elements.

is_started
boolean
required

Boolean indicating if the operation has started.

is_finished
boolean
required

Boolean indicating if the operations has finished.

all_good
boolean | null
required

Boolean indicating that there is no failed elements yet.

do_wait
boolean
required

Boolean for know if have to wait or not.

do_urgent
boolean
required

Boolean for know if it is an urgent operation.

do_strict
boolean
required

Boolean for know if is required strict operations over DB.

idle_ms
number
required

Duration (milliseconds) between the operation has been created and has started.

exec_ms
number
required

Duration (milliseconds) between the operation has been started and has finished.

created_at
string
required

Creation datetime.

started_at
string
required

Start datetime.

finished_at
string
required

Finalization datetime.

errors
OpError · object[]
required

List of errors that occurred during processing the operation.