Update an existing photo mockup
Rename a mockup and/or set the colours it answers to by name. A render may then send a name where it would send a hex code.
PATCH
/
api
/
v1
/
photo-mockups
/
{mockup_id}
const response = await fetch("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6", {
method: "PATCH",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Updated Mockup Name"
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"name": "Updated Mockup Name"
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"x-api-key: sm_your_api_key",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
payload = {'name': 'Updated Mockup Name'}
response = requests.patch(
"https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6",
headers={"x-api-key": "sm_your_api_key"},
json=payload,
)
response.raise_for_status()
print(response.json())
require "net/http"
require "uri"
uri = URI("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6")
request = Net::HTTP::Patch.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"name": "Updated Mockup Name"
}
JSON
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"name": "Updated Mockup Name"
}`)
req, err := http.NewRequest("PATCH", "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("x-api-key", "sm_your_api_key")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String payload = """
{
"name": "Updated Mockup Name"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6"))
.header("x-api-key", "sm_your_api_key")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
using System.Net.Http;
using System.Text;
var payload = """
{
"name": "Updated Mockup Name"
}
""";
var request = new HttpRequestMessage(HttpMethod.Patch, "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6");
request.Headers.Add("x-api-key", "sm_your_api_key");
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
var client = new HttpClient();
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl -X PATCH "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Mockup Name"
}'
{
"data": {
"colors": [
{
"hex": "#6A8296",
"label": "blue jean"
},
{
"hex": "#E4DED3",
"label": "bone"
}
],
"name": "Front view",
"uuid": "893ea326-278b-480b-b130-87dd6aee06dc"
},
"success": true
}
const response = await fetch("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6", {
method: "PATCH",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Updated Mockup Name"
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"name": "Updated Mockup Name"
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"x-api-key: sm_your_api_key",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
payload = {'name': 'Updated Mockup Name'}
response = requests.patch(
"https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6",
headers={"x-api-key": "sm_your_api_key"},
json=payload,
)
response.raise_for_status()
print(response.json())
require "net/http"
require "uri"
uri = URI("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6")
request = Net::HTTP::Patch.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"name": "Updated Mockup Name"
}
JSON
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"name": "Updated Mockup Name"
}`)
req, err := http.NewRequest("PATCH", "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("x-api-key", "sm_your_api_key")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String payload = """
{
"name": "Updated Mockup Name"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6"))
.header("x-api-key", "sm_your_api_key")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
using System.Net.Http;
using System.Text;
var payload = """
{
"name": "Updated Mockup Name"
}
""";
var request = new HttpRequestMessage(HttpMethod.Patch, "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6");
request.Headers.Add("x-api-key", "sm_your_api_key");
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
var client = new HttpClient();
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl -X PATCH "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Mockup Name"
}'
{
"data": {
"colors": [
{
"hex": "#6A8296",
"label": "blue jean"
},
{
"hex": "#E4DED3",
"label": "bone"
}
],
"name": "Front view",
"uuid": "893ea326-278b-480b-b130-87dd6aee06dc"
},
"success": true
}
Authorizations
API key with sm_ prefix. Get your key at https://sudomock.com/dashboard/api-keys
Path Parameters
Id of the photo mockup to rename or give named colours.
Body
application/json
Update request for PATCH /api/v1/psd-mockups/{uuid}
New mockup name
Required string length:
1 - 255The colours this mockup answers to by name. Replaces the whole list, so send every colour you want to keep. Send [] to clear it.
Maximum array length:
96Show child attributes
Show child attributes
The folder to move this mockup into. Send null to move it to the top of the library. Leave it out to leave it where it is.
Example:
"c4f1a7d2-3b85-4e60-9a1f-7d2c5e8b4061"
Was this page helpful?
⌘I
const response = await fetch("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6", {
method: "PATCH",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Updated Mockup Name"
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"name": "Updated Mockup Name"
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"x-api-key: sm_your_api_key",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
payload = {'name': 'Updated Mockup Name'}
response = requests.patch(
"https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6",
headers={"x-api-key": "sm_your_api_key"},
json=payload,
)
response.raise_for_status()
print(response.json())
require "net/http"
require "uri"
uri = URI("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6")
request = Net::HTTP::Patch.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"name": "Updated Mockup Name"
}
JSON
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"name": "Updated Mockup Name"
}`)
req, err := http.NewRequest("PATCH", "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("x-api-key", "sm_your_api_key")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String payload = """
{
"name": "Updated Mockup Name"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6"))
.header("x-api-key", "sm_your_api_key")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
using System.Net.Http;
using System.Text;
var payload = """
{
"name": "Updated Mockup Name"
}
""";
var request = new HttpRequestMessage(HttpMethod.Patch, "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6");
request.Headers.Add("x-api-key", "sm_your_api_key");
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
var client = new HttpClient();
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl -X PATCH "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Mockup Name"
}'
{
"data": {
"colors": [
{
"hex": "#6A8296",
"label": "blue jean"
},
{
"hex": "#E4DED3",
"label": "bone"
}
],
"name": "Front view",
"uuid": "893ea326-278b-480b-b130-87dd6aee06dc"
},
"success": true
}