const response = await fetch("https://api.sudomock.com/api/v1/studio/config", {
method: "PUT",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/studio/config");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
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 = {
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
response = requests.put(
"https://api.sudomock.com/api/v1/studio/config",
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/studio/config")
request = Net::HTTP::Put.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
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(`{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}`)
req, err := http.NewRequest("PUT", "https://api.sudomock.com/api/v1/studio/config", 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 = """
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/studio/config"))
.header("x-api-key", "sm_your_api_key")
.header("Content-Type", "application/json")
.PUT(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 = """
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
""";
var request = new HttpRequestMessage(HttpMethod.Put, "https://api.sudomock.com/api/v1/studio/config");
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 PUT "https://api.sudomock.com/api/v1/studio/config" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}'
{
"success": true,
"config": {
"accentColor": "#da7756",
"backgroundColor": "#f1f5f9",
"borderRadius": 10,
"headerText": "Customize Your Design",
"primaryColor": "#0f172a",
"uploadText": "Drop image or click to upload"
},
"config_version": 3
}
Update the Studio config
Updates the Studio appearance and controls for this API key.
PUT
/
api
/
v1
/
studio
/
config
const response = await fetch("https://api.sudomock.com/api/v1/studio/config", {
method: "PUT",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/studio/config");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
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 = {
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
response = requests.put(
"https://api.sudomock.com/api/v1/studio/config",
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/studio/config")
request = Net::HTTP::Put.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
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(`{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}`)
req, err := http.NewRequest("PUT", "https://api.sudomock.com/api/v1/studio/config", 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 = """
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/studio/config"))
.header("x-api-key", "sm_your_api_key")
.header("Content-Type", "application/json")
.PUT(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 = """
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
""";
var request = new HttpRequestMessage(HttpMethod.Put, "https://api.sudomock.com/api/v1/studio/config");
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 PUT "https://api.sudomock.com/api/v1/studio/config" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}'
{
"success": true,
"config": {
"accentColor": "#da7756",
"backgroundColor": "#f1f5f9",
"borderRadius": 10,
"headerText": "Customize Your Design",
"primaryColor": "#0f172a",
"uploadText": "Drop image or click to upload"
},
"config_version": 3
}
What you send is merged into the stored configuration for the API key that made
the call, so one write can carry a single field or all of them. Send
config_version as the version you last read: the write lands only while that is
still the stored version, and the response returns the effective configuration
with its new version number. Sending a field as null drops your override and
returns that control to its default.
Every header control can be turned off,
showClose included. With nothing
visible left in it the header is not drawn at all, and closing the editor
becomes the host page’s job. Keep twoDShowArtwork or twoDShowFill on, so a
shopper always has a way to finish a design in the photo editor.const response = await fetch("https://api.sudomock.com/api/v1/studio/config", {
method: "PUT",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/studio/config");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
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 = {
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
response = requests.put(
"https://api.sudomock.com/api/v1/studio/config",
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/studio/config")
request = Net::HTTP::Put.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
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(`{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}`)
req, err := http.NewRequest("PUT", "https://api.sudomock.com/api/v1/studio/config", 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 = """
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/studio/config"))
.header("x-api-key", "sm_your_api_key")
.header("Content-Type", "application/json")
.PUT(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 = """
{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}
""";
var request = new HttpRequestMessage(HttpMethod.Put, "https://api.sudomock.com/api/v1/studio/config");
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 PUT "https://api.sudomock.com/api/v1/studio/config" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"config": {
"accentColor": "#FF5733",
"theme": "dark"
},
"config_version": 3
}'
{
"success": true,
"config": {
"accentColor": "#da7756",
"backgroundColor": "#f1f5f9",
"borderRadius": 10,
"headerText": "Customize Your Design",
"primaryColor": "#0f172a",
"uploadText": "Drop image or click to upload"
},
"config_version": 3
}
Authorizations
API key with sm_ prefix. Get your key at https://sudomock.com/dashboard/api-keys
Body
application/json
Response
200 - application/json
Successful Response
True when the configuration was returned.
The effective Studio configuration for this API key.
Example:
{ "accentColor": "#da7756", "backgroundColor": "#f1f5f9", "borderRadius": 10, "headerText": "Customize Your Design", "primaryColor": "#0f172a", "uploadText": "Drop image or click to upload" }
Version of the stored configuration, which rises with every update.
Example:
3
Was this page helpful?
⌘I