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

# List library templates

> Search SudoMock's ready-made library. Nothing in it needs a Photoshop file or a product photo of your own, and every mockup in it is free to start from.

A mockup is one view of a product scene, and a template is the set of views of that scene: front, folded, flat lay, lifestyle, close-up. The answer counts both, as total_templates and total_mockups, and every template carries its mockups with the address to render from, so one call is enough to act on.

To use one, send a mockup's source_url to POST /api/v1/photo-mockups: it becomes a reusable mockup on your account for 25 credits, and each render of that mockup costs 5. Reading the library costs nothing.

```js Node.js theme={"theme":{"light":"github-light","dark":"vesper"}}
const response = await fetch("https://api.sudomock.com/api/v1/library/templates", {
  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/library/templates");
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/library/templates",
    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/library/templates")
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/library/templates", 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/library/templates"))
    .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/library/templates");
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/library/templates" \
  -H "x-api-key: sm_your_api_key"
```

```json Response theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "templates": [
    {
      "slug": "string",
      "title": "string",
      "description": "string",
      "category": "string",
      "subcategory": "string",
      "product_type": "string",
      "tags": [
        "string"
      ],
      "is_featured": false,
      "mockup_count": 1,
      "mockups": [
        {}
      ]
    }
  ],
  "total_templates": 1,
  "total_mockups": 1,
  "page": 1,
  "limit": 1,
  "pages": 1
}
```


## OpenAPI

````yaml openapi.json GET /api/v1/library/templates
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: Patterns
    description: Check a repeating pattern tile for seams and fix them.
  - 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 seam fixes, and read their results.
  - name: Account
    description: Read the current account, its plan and its remaining credits.
  - name: Folders
    description: Group mockups into folders that nest.
  - name: Library
    description: >-
      Search the ready-made library and read one template with the mockups it
      holds.
paths:
  /api/v1/library/templates:
    get:
      tags:
        - Library
      summary: List library templates
      description: >-
        Search SudoMock's ready-made library. Nothing in it needs a Photoshop
        file or a product photo of your own, and every mockup in it is free to
        start from.


        A mockup is one view of a product scene, and a template is the set of
        views of that scene: front, folded, flat lay, lifestyle, close-up. The
        answer counts both, as total_templates and total_mockups, and every
        template carries its mockups with the address to render from, so one
        call is enough to act on.


        To use one, send a mockup's source_url to POST /api/v1/photo-mockups: it
        becomes a reusable mockup on your account for 25 credits, and each
        render of that mockup costs 5. Reading the library costs nothing.
      operationId: list_library_templates_api_v1_library_templates_get
      parameters:
        - name: category
          in: query
          required: false
          schema:
            type: string
            description: >-
              Keep only one top category: apparel, home-living, accessories,
              drinkware, signage-advertising, print-paper, packaging, branding.
          description: >-
            Keep only one top category: apparel, home-living, accessories,
            drinkware, signage-advertising, print-paper, packaging, branding.
        - name: subcategory
          in: query
          required: false
          schema:
            type: string
            description: >-
              Keep only one subcategory, the middle level: t-shirts, mugs,
              wallpaper, tote-bags.
          description: >-
            Keep only one subcategory, the middle level: t-shirts, mugs,
            wallpaper, tote-bags.
        - name: product_type
          in: query
          required: false
          schema:
            type: string
            description: >-
              Keep only one product type, the narrowest level:
              crewneck-short-sleeve, classic-ceramic-mug, wall-mural, tote-bag.
          description: >-
            Keep only one product type, the narrowest level:
            crewneck-short-sleeve, classic-ceramic-mug, wall-mural, tote-bag.
        - name: tags
          in: query
          required: false
          schema:
            type: string
            description: >-
              Keep only templates carrying these tags, comma-separated
              (t-shirt-mockup).
          description: >-
            Keep only templates carrying these tags, comma-separated
            (t-shirt-mockup).
        - name: platforms
          in: query
          required: false
          schema:
            type: string
            description: >-
              Keep only templates marked for these storefronts or automation
              tools, comma-separated (etsy, shopify, woocommerce, zapier, make,
              n8n).
          description: >-
            Keep only templates marked for these storefronts or automation
            tools, comma-separated (etsy, shopify, woocommerce, zapier, make,
            n8n).
        - name: industries
          in: query
          required: false
          schema:
            type: string
            description: Keep only templates marked for these industries, comma-separated.
          description: Keep only templates marked for these industries, comma-separated.
        - name: use_cases
          in: query
          required: false
          schema:
            type: string
            description: Keep only templates marked for these use cases, comma-separated.
          description: Keep only templates marked for these use cases, comma-separated.
        - name: is_featured
          in: query
          required: false
          schema:
            type: boolean
            description: Keep only the templates we feature, or only the rest.
          description: Keep only the templates we feature, or only the rest.
        - name: search
          in: query
          required: false
          schema:
            type: string
            description: >-
              Free text matched against a template's title and description, so
              "coffee mug" or "oversized tee" both work.
          description: >-
            Free text matched against a template's title and description, so
            "coffee mug" or "oversized tee" both work.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Which page of results to return, counting from 1.
            default: 1
          description: Which page of results to return, counting from 1.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Templates per page, 1 to 100.
            default: 20
          description: Templates per page, 1 to 100.
        - name: sort_by
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/PublicLibrarySortField'
            description: Which field the results are ordered by.
            default: published_at
          description: Which field the results are ordered by.
        - name: sort_order
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/SortOrder'
            description: 'Order: desc (default) or asc.'
            default: desc
          description: 'Order: desc (default) or asc.'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicLibraryTemplateList'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Node.js
          source: >-
            const response = await
            fetch("https://api.sudomock.com/api/v1/library/templates", {
              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/library/templates");

            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/library/templates",
                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/library/templates")

            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/library/templates\", 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/library/templates"))
                .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/library/templates");

            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/library/templates" \
              -H "x-api-key: sm_your_api_key"
components:
  schemas:
    PublicLibrarySortField:
      type: string
      enum:
        - published_at
        - title
      title: PublicLibrarySortField
      description: What the listing can be ordered by.
    SortOrder:
      type: string
      enum:
        - asc
        - desc
      title: SortOrder
      description: Sort direction.
    PublicLibraryTemplateList:
      properties:
        templates:
          items:
            $ref: '#/components/schemas/PublicLibraryTemplate'
          type: array
          description: The templates on this page.
        total_templates:
          type: integer
          description: How many templates match the filters, across every page.
        total_mockups:
          type: integer
          description: >-
            How many mockups those templates hold between them, across every
            page.
        page:
          type: integer
          description: Which page this is, counting from 1.
        limit:
          type: integer
          description: How many templates one page carries.
        pages:
          type: integer
          description: How many pages the filters match.
      type: object
      required:
        - total_templates
        - total_mockups
        - page
        - limit
        - pages
      title: PublicLibraryTemplateList
      description: A page of templates, counted in both units.
    PublicLibraryTemplate:
      properties:
        slug:
          type: string
          description: The template's stable name, used to read it on its own.
        title:
          type: string
          description: Display title of the product scene.
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: One or two sentences about the scene.
        category:
          type: string
          description: Top category, such as apparel or drinkware.
        subcategory:
          anyOf:
            - type: string
            - type: 'null'
          description: Middle level, such as t-shirts.
        product_type:
          anyOf:
            - type: string
            - type: 'null'
          description: Narrowest level, such as crewneck-short-sleeve.
        tags:
          items:
            type: string
          type: array
          description: Tags the template is filterable by.
        is_featured:
          type: boolean
          description: Whether the template is one we feature.
          default: false
        mockup_count:
          type: integer
          description: How many mockups this template holds.
        mockups:
          items:
            $ref: '#/components/schemas/PublicLibraryMockup'
          type: array
          description: >-
            Every mockup of the template, each with the address to render from,
            so a search answers with what to send next and needs no second call.
      type: object
      required:
        - slug
        - title
        - category
        - mockup_count
      title: PublicLibraryTemplate
      description: 'One template: a product scene, with the mockups it holds.'
    PublicLibraryMockup:
      properties:
        name:
          type: string
          description: What this view is called, such as "Flat Lay" or "Lifestyle Scene".
        view:
          type: string
          description: The kind of view, such as flat-lay-overhead or lifestyle-scene.
        source_url:
          type: string
          description: >-
            Public image address of this mockup. Send it as source_url to POST
            /api/v1/photo-mockups and it becomes a reusable mockup on your
            account for 25 credits; each render of that mockup then costs 5.
      type: object
      required:
        - name
        - view
        - source_url
      title: PublicLibraryMockup
      description: 'One mockup: a single view of a product scene, ready to render on.'
  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.