> ## 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.

# Retrieve the layers of a PSD mockup

> Read every layer of a mockup, nested the way Photoshop's Layers panel shows them and listed front-most first. A smart object whose contents hold layers you can fill lists those layers as its children. Send a layer's uuid in hidden_layers on POST /api/v1/renders to leave that layer out of a render.

<RequestExample>
  ```js Node.js theme={"theme":{"light":"github-light","dark":"vesper"}}
  const response = await fetch("https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers", {
    method: "GET",
    headers: { "x-api-key": "sm_your_api_key" },
  });

  const data = await response.json();
  console.log(data);
  ```

  ```php PHP theme={"theme":{"light":"github-light","dark":"vesper"}}
  <?php

  $ch = curl_init("https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers");
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "x-api-key: sm_your_api_key",
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}}
  import requests

  response = requests.get(
      "https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers",
      headers={"x-api-key": "sm_your_api_key"},
  )

  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/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers")
  request = Net::HTTP::Get.new(uri)
  request["x-api-key"] = "sm_your_api_key"

  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 (
  	"fmt"
  	"io"
  	"net/http"
  )

  func main() {
  	req, err := http.NewRequest("GET", "https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers", nil)
  	if err != nil {
  		panic(err)
  	}
  	req.Header.Set("x-api-key", "sm_your_api_key")

  	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;

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers"))
      .header("x-api-key", "sm_your_api_key")
      .GET()
      .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 request = new HttpRequestMessage(HttpMethod.Get, "https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers");
  request.Headers.Add("x-api-key", "sm_your_api_key");

  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 GET "https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers" \
    -H "x-api-key: sm_your_api_key"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={"theme":{"light":"github-light","dark":"vesper"}}
  {
    "data": {
      "layers": [
        {
          "children": [
            {
              "children": [],
              "kind": "text",
              "name": "Badge text",
              "uuid": "523e4567-e89b-12d3-a456-426614174004",
              "visible": true
            },
            {
              "children": [],
              "kind": "shape",
              "name": "Badge shape",
              "uuid": "623e4567-e89b-12d3-a456-426614174005",
              "visible": true
            }
          ],
          "kind": "group",
          "name": "Sleeve badge",
          "uuid": "423e4567-e89b-12d3-a456-426614174003",
          "visible": true
        },
        {
          "children": [],
          "kind": "text",
          "name": "Name",
          "uuid": "323e4567-e89b-12d3-a456-426614174002",
          "visible": true
        },
        {
          "children": [],
          "kind": "text",
          "name": "Nickname",
          "uuid": "923e4567-e89b-12d3-a456-426614174008",
          "visible": false
        },
        {
          "children": [],
          "kind": "smart_object",
          "name": "Main Design",
          "uuid": "223e4567-e89b-12d3-a456-426614174001",
          "visible": true
        },
        {
          "children": [],
          "kind": "pixel",
          "name": "T-shirt",
          "uuid": "723e4567-e89b-12d3-a456-426614174006",
          "visible": true
        },
        {
          "children": [],
          "kind": "fill",
          "name": "Background",
          "uuid": "823e4567-e89b-12d3-a456-426614174007",
          "visible": true
        }
      ],
      "mockup_uuid": "123e4567-e89b-12d3-a456-426614174000"
    },
    "success": true
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.json GET /api/v1/psd-mockups/{uuid}/layers
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/psd-mockups/{uuid}/layers:
    get:
      tags:
        - PSD mockups
      summary: Retrieve the layers of a PSD mockup
      description: >-
        Read every layer of a mockup, nested the way Photoshop's Layers panel
        shows them and listed front-most first. A smart object whose contents
        hold layers you can fill lists those layers as its children. Send a
        layer's uuid in hidden_layers on POST /api/v1/renders to leave that
        layer out of a render.
      operationId: get_mockup_layers_api_v1_psd_mockups__uuid__layers_get
      parameters:
        - name: uuid
          in: path
          required: true
          schema:
            type: string
            minLength: 36
            description: Mockup UUID
            examples:
              - 123e4567-e89b-12d3-a456-426614174000
          description: Mockup UUID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MockupLayersResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Node.js
          source: >-
            const response = await
            fetch("https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers",
            {
              method: "GET",
              headers: { "x-api-key": "sm_your_api_key" },
            });


            const data = await response.json();

            console.log(data);
        - lang: PHP
          source: >-
            <?php


            $ch =
            curl_init("https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers");

            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "x-api-key: sm_your_api_key",
            ]);


            $response = curl_exec($ch);

            curl_close($ch);


            echo $response;
        - lang: Python
          source: |-
            import requests

            response = requests.get(
                "https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers",
                headers={"x-api-key": "sm_your_api_key"},
            )

            response.raise_for_status()
            print(response.json())
        - lang: Ruby
          source: >-
            require "net/http"

            require "uri"


            uri =
            URI("https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers")

            request = Net::HTTP::Get.new(uri)

            request["x-api-key"] = "sm_your_api_key"


            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\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"x-api-key\", \"sm_your_api_key\")\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;

            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers"))
                .header("x-api-key", "sm_your_api_key")
                .GET()
                .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 request = new HttpRequestMessage(HttpMethod.Get,
            "https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers");

            request.Headers.Add("x-api-key", "sm_your_api_key");


            var client = new HttpClient();

            var response = await client.SendAsync(request);


            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: cURL
          source: >-
            curl -X GET
            "https://api.sudomock.com/api/v1/psd-mockups/123e4567-e89b-12d3-a456-426614174000/layers"
            \
              -H "x-api-key: sm_your_api_key"
components:
  schemas:
    MockupLayersResponse:
      properties:
        success:
          type: boolean
          description: Always true on a successful response.
          default: true
          examples:
            - true
        data:
          $ref: '#/components/schemas/MockupLayersData'
          description: The mockup's layers.
      type: object
      required:
        - data
      title: MockupLayersResponse
      description: >-
        Every layer of a PSD mockup, nested the way Photoshop's Layers panel
        shows them.
      example:
        data:
          layers:
            - children:
                - children: []
                  kind: text
                  name: Badge text
                  uuid: 523e4567-e89b-12d3-a456-426614174004
                  visible: true
                - children: []
                  kind: shape
                  name: Badge shape
                  uuid: 623e4567-e89b-12d3-a456-426614174005
                  visible: true
              kind: group
              name: Sleeve badge
              uuid: 423e4567-e89b-12d3-a456-426614174003
              visible: true
            - children: []
              kind: text
              name: Name
              uuid: 323e4567-e89b-12d3-a456-426614174002
              visible: true
            - children: []
              kind: text
              name: Nickname
              uuid: 923e4567-e89b-12d3-a456-426614174008
              visible: false
            - children: []
              kind: smart_object
              name: Main Design
              uuid: 223e4567-e89b-12d3-a456-426614174001
              visible: true
            - children: []
              kind: pixel
              name: T-shirt
              uuid: 723e4567-e89b-12d3-a456-426614174006
              visible: true
            - children: []
              kind: fill
              name: Background
              uuid: 823e4567-e89b-12d3-a456-426614174007
              visible: true
          mockup_uuid: 123e4567-e89b-12d3-a456-426614174000
        success: true
    MockupLayersData:
      properties:
        mockup_uuid:
          type: string
          description: The mockup these layers belong to.
          examples:
            - 123e4567-e89b-12d3-a456-426614174000
        layers:
          items:
            $ref: '#/components/schemas/MockupLayer'
          type: array
          description: >-
            Top-level layers, front-most first, in the order Photoshop's Layers
            panel lists them. A group carries its own layers in children, and so
            does a smart object whose contents hold layers you can fill.
      type: object
      required:
        - mockup_uuid
        - layers
      title: MockupLayersData
      description: The layers of one PSD mockup.
    MockupLayer:
      properties:
        uuid:
          type: string
          description: >-
            The layer's UUID. Send it in hidden_layers to leave the layer out of
            a render. A smart object, text layer or group listed in the mockup's
            smart_objects, text_layers or group_layers carries the same UUID
            here.
          examples:
            - 423e4567-e89b-12d3-a456-426614174003
        name:
          type: string
          description: The layer's name in the PSD.
          examples:
            - Sleeve badge
        kind:
          type: string
          description: >-
            What the layer is: artboard, group, smart_object, text, pixel,
            shape, fill or adjustment.
          examples:
            - group
        visible:
          type: boolean
          description: >-
            Whether the layer is shown in the source file. False as well when a
            group or artboard around it is hidden.
          examples:
            - true
        children:
          items:
            $ref: '#/components/schemas/MockupLayer'
          type: array
          description: >-
            The layers inside this layer, front-most first: a group's own
            layers, or the layers of a smart object's contents when those
            contents hold layers you can fill. Copies of one smart object share
            their contents, which are listed under one copy. An artboard's own
            layers are listed right before the artboard at the top level, not
            here. Empty for every other layer.
      type: object
      required:
        - uuid
        - name
        - kind
        - visible
      title: MockupLayer
      description: One layer of a PSD mockup, as Photoshop's Layers panel shows 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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.