> ## Documentation Index
> Fetch the complete documentation index at: https://sudomock.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The base URL is https://api.sudomock.com.
> Authenticate every request with the x-api-key header. Keys begin with sm_.
> A render returns the finished image at data.print_files[0].export_path. A request sent with is_async true returns a job_id to poll at GET /api/v1/jobs/{job_id}.
> Prefer the official SDKs over hand-written HTTP calls: npm install sudomock for Node, pip install sudomock for Python.

# Update the Studio config

> Merchant updates Studio branding/features. Requires x-api-key header. Header controls may all be turned off, showClose included; when no visible control remains the header is not shown at all, and closing the editor becomes the host page's responsibility. This is accepted on purpose and is not rejected.

<RequestExample>
  ```js Node.js theme={"theme":{"light":"github-light","dark":"vesper"}}
  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 PHP theme={"theme":{"light":"github-light","dark":"vesper"}}
  <?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;
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}}
  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())
  ```

  ```ruby Ruby theme={"theme":{"light":"github-light","dark":"vesper"}}
  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
  ```

  ```go Go theme={"theme":{"light":"github-light","dark":"vesper"}}
  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))
  }
  ```

  ```java Java theme={"theme":{"light":"github-light","dark":"vesper"}}
  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());
  ```

  ```csharp .NET theme={"theme":{"light":"github-light","dark":"vesper"}}
  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());
  ```

  ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}}
  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
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={"theme":{"light":"github-light","dark":"vesper"}}
  {}
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.json PUT /api/v1/studio/config
openapi: 3.1.0
info:
  title: SudoMock API
  description: >-
    Product mockup API. Render PSD templates, turn product photos into reusable
    mockups, create still images and videos, personalize text with fonts, and
    manage asynchronous jobs and signed webhooks.


    Every endpoint answers failures with the same envelope, so the status codes,
    the error_code values and the retry rule are documented once at
    https://sudomock.com/docs/errors rather than repeated per operation.
  version: 1.0.0
servers:
  - url: https://api.sudomock.com
    description: Production
security: []
tags:
  - name: PSD mockups
    description: Turn a Photoshop file into a reusable mockup, then render it.
  - name: Photo mockups
    description: Turn a product photo into a reusable mockup, then render artwork onto it.
  - name: Video mockups
    description: Render a mockup as a short video.
  - name: Fonts
    description: Upload and manage the fonts available to text layers.
  - name: Background removal
    description: Isolate a subject from its background as a standalone step.
  - name: Studio
    description: Open an embedded editor session and read what the customer produced in it.
  - name: Webhook endpoints
    description: Register signed endpoints and manage their secrets.
  - name: Webhook deliveries
    description: Inspect, replay and retry what those endpoints received.
  - name: Jobs
    description: Poll queued renders and read their results.
  - name: Account
    description: Read the current account, its plan and its remaining credits.
paths:
  /api/v1/studio/config:
    put:
      tags:
        - Studio
      summary: Update the Studio config
      description: >-
        Merchant updates Studio branding/features. Requires x-api-key header.
        Header controls may all be turned off, showClose included; when no
        visible control remains the header is not shown at all, and closing the
        editor becomes the host page's responsibility. This is accepted on
        purpose and is not rejected.
      operationId: update_studio_config_api_v1_studio_config_put
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateStudioConfigRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudioConfigResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Node.js
          source: >-
            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);
        - lang: PHP
          source: |-
            <?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;
        - lang: Python
          source: |-
            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())
        - lang: Ruby
          source: >-
            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
        - lang: Go
          source: "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tpayload := []byte(`{\n  \"config\": {\n    \"accentColor\": \"#FF5733\",\n    \"theme\": \"dark\"\n  },\n  \"config_version\": 3\n}`)\n\n\treq, err := http.NewRequest(\"PUT\", \"https://api.sudomock.com/api/v1/studio/config\", bytes.NewBuffer(payload))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"x-api-key\", \"sm_your_api_key\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tbody, _ := io.ReadAll(res.Body)\n\tfmt.Println(string(body))\n}"
        - lang: Java
          source: |-
            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());
        - lang: .NET
          source: >-
            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());
        - lang: cURL
          source: |-
            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
              }'
components:
  schemas:
    UpdateStudioConfigRequest:
      properties:
        config_version:
          type: integer
          minimum: 0
          examples:
            - 3
        config:
          $ref: '#/components/schemas/StudioConfigPatch'
      additionalProperties: false
      type: object
      required:
        - config_version
        - config
      title: UpdateStudioConfigRequest
      example:
        config:
          accentColor: '#FF5733'
          theme: dark
        config_version: 3
    StudioConfigResponse:
      properties:
        success:
          type: boolean
          default: true
        config:
          additionalProperties: true
          type: object
          default: {}
        config_version:
          type: integer
          default: 0
          examples:
            - 3
      type: object
      title: StudioConfigResponse
    StudioConfigPatch:
      properties:
        primaryColor:
          anyOf:
            - type: string
              pattern: ^#[0-9A-Fa-f]{6}$
            - type: 'null'
          default: '#0f172a'
        accentColor:
          anyOf:
            - type: string
              pattern: ^#[0-9A-Fa-f]{6}$
            - type: 'null'
          default: '#da7756'
        backgroundColor:
          anyOf:
            - type: string
              pattern: ^#[0-9A-Fa-f]{6}$
            - type: 'null'
          default: '#f1f5f9'
        panelBackground:
          anyOf:
            - type: string
              pattern: ^#[0-9A-Fa-f]{6}$
            - type: 'null'
          default: '#ffffff'
        textColor:
          anyOf:
            - type: string
              pattern: ^#[0-9A-Fa-f]{6}$
            - type: 'null'
          default: '#0f172a'
        borderColor:
          anyOf:
            - type: string
              pattern: ^#[0-9A-Fa-f]{6}$
            - type: 'null'
          default: '#e2e8f0'
        successColor:
          anyOf:
            - type: string
              pattern: ^#[0-9A-Fa-f]{6}$
            - type: 'null'
          default: '#16a34a'
        borderRadius:
          anyOf:
            - type: integer
              maximum: 20
              minimum: 0
            - type: 'null'
          default: 10
        logoUrl:
          anyOf:
            - type: string
              maxLength: 2048
            - type: 'null'
          examples:
            - https://your-store.example.com/assets/logo.png
        fontFamily:
          anyOf:
            - type: string
              maxLength: 64
              minLength: 1
              pattern: ^[A-Za-z0-9][A-Za-z0-9 ,._-]*$
            - type: 'null'
          examples:
            - Inter, sans-serif
        headerText:
          anyOf:
            - type: string
              maxLength: 96
            - type: 'null'
          default: Customize Your Design
        uploadText:
          anyOf:
            - type: string
              maxLength: 96
              minLength: 1
            - type: 'null'
          default: Drop image or click to upload
        secondaryActionLabel:
          anyOf:
            - type: string
              maxLength: 96
              minLength: 1
            - type: 'null'
          default: Render Preview
        loadingText:
          anyOf:
            - type: string
              maxLength: 96
              minLength: 1
            - type: 'null'
          default: Adding...
        successText:
          anyOf:
            - type: string
              maxLength: 96
              minLength: 1
            - type: 'null'
          default: Added!
        psdPrimaryActionLabel:
          anyOf:
            - type: string
              maxLength: 96
              minLength: 1
            - type: 'null'
          default: Add to Cart
        twoDSetupPrimaryActionLabel:
          anyOf:
            - type: string
              maxLength: 96
              minLength: 1
            - type: 'null'
          default: Save Mockup
        twoDCustomizePrimaryActionLabel:
          anyOf:
            - type: string
              maxLength: 96
              minLength: 1
            - type: 'null'
          default: Add to Cart
        psdShowAdjustments:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdShowColorOverlay:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdShowTextLayers:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdShowFitMode:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdShowPosition:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdShowSize:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdShowRotation:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdShowFlip:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdShowExportOptions:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdShowZoomControls:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdShowUndoRedo:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdAutoRender:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        psdAutoRenderDelay:
          anyOf:
            - type: integer
              maximum: 3000
              minimum: 300
            - type: 'null'
          default: 800
        autoDesignCallback:
          anyOf:
            - type: boolean
            - type: 'null'
          default: false
        psdLayout:
          anyOf:
            - type: string
              enum:
                - full
                - compact
            - type: 'null'
          default: full
        twoDShowArtwork:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        twoDShowFill:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        twoDShowBlend:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        twoDShowOpacity:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        twoDShowTransform:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        twoDShowZoom:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        twoDShowExport:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        twoDShowBackgroundRemoval:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        colorPalette:
          anyOf:
            - items:
                $ref: '#/components/schemas/PaletteColour'
              type: array
              maxItems: 96
              minItems: 1
            - type: 'null'
          examples:
            - - hex: '#1a1a1a'
                label: Black
              - hex: '#f5f5f5'
                label: Natural
        showClose:
          anyOf:
            - type: boolean
            - type: 'null'
          default: true
        theme:
          anyOf:
            - type: string
              enum:
                - light
                - dark
            - type: 'null'
          default: light
        locale:
          anyOf:
            - type: string
              enum:
                - en
                - tr
            - type: 'null'
          default: en
        maxFileSize:
          anyOf:
            - type: integer
              maximum: 50
              minimum: 1
            - type: 'null'
          default: 15
      additionalProperties: false
      type: object
      title: StudioConfigPatch
    PaletteColour:
      properties:
        hex:
          type: string
          pattern: ^#[0-9A-Fa-f]{6}$
          examples:
            - '#1a1a1a'
        label:
          anyOf:
            - type: string
              maxLength: 32
            - type: 'null'
          examples:
            - Black Heather
      additionalProperties: false
      type: object
      required:
        - hex
      title: PaletteColour
      description: One colour the editor offers, with your name for it.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key with sm_ prefix. Get your key at
        https://sudomock.com/dashboard/api-keys

````