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

# Create a new font

> Upload a custom TTF or OTF font (Pro plan and above). Send either a multipart 'file' or a JSON body with a public 'url'. The font is validated and security-checked before it is stored.

<RequestExample>
  ```js Node.js theme={"theme":{"light":"github-light","dark":"vesper"}}
  const response = await fetch("https://api.sudomock.com/api/v1/fonts", {
    method: "POST",
    headers: {
      "x-api-key": "sm_your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "url": "https://example.com/fonts/MyBrand-Bold.ttf"
    }),
  });

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

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

  $payload = <<<'JSON'
  {
    "url": "https://example.com/fonts/MyBrand-Bold.ttf"
  }
  JSON;

  $ch = curl_init("https://api.sudomock.com/api/v1/fonts");
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  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 = {
      "url": "https://example.com/fonts/MyBrand-Bold.ttf"
  }

  response = requests.post(
      "https://api.sudomock.com/api/v1/fonts",
      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/fonts")
  request = Net::HTTP::Post.new(uri)
  request["x-api-key"] = "sm_your_api_key"
  request["Content-Type"] = "application/json"

  request.body = <<~JSON
    {
      "url": "https://example.com/fonts/MyBrand-Bold.ttf"
    }
  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(`{
    "url": "https://example.com/fonts/MyBrand-Bold.ttf"
  }`)

  	req, err := http.NewRequest("POST", "https://api.sudomock.com/api/v1/fonts", 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 = """
  {
    "url": "https://example.com/fonts/MyBrand-Bold.ttf"
  }
  """;

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.sudomock.com/api/v1/fonts"))
      .header("x-api-key", "sm_your_api_key")
      .header("Content-Type", "application/json")
      .POST(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 = """
  {
    "url": "https://example.com/fonts/MyBrand-Bold.ttf"
  }
  """;

  var request = new HttpRequestMessage(HttpMethod.Post, "https://api.sudomock.com/api/v1/fonts");
  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 POST "https://api.sudomock.com/api/v1/fonts" \
    -H "x-api-key: sm_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://example.com/fonts/MyBrand-Bold.ttf"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={"theme":{"light":"github-light","dark":"vesper"}}
  {
    "category": "sans-serif",
    "created_at": "2026-07-13T00:00:00+00:00",
    "family": "Open Sans",
    "file_url": "https://cdn.sudomock.com/mockup-assets/fonts/web/9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f.woff2",
    "is_premium": false,
    "is_system": true,
    "license": "OFL",
    "postscript_name": "OpenSans-Regular",
    "subfamily": "Regular",
    "uuid": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
    "preview_url": null
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.json POST /api/v1/fonts
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/fonts:
    post:
      tags:
        - Fonts
      summary: Create a new font
      description: >-
        Upload a custom TTF or OTF font (Pro plan and above). Send either a
        multipart 'file' or a JSON body with a public 'url'. The font is
        validated and security-checked before it is stored.
      operationId: upload_font_api_v1_fonts_post
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
                - license_confirmed
              properties:
                file:
                  type: string
                  format: binary
                license_confirmed:
                  type: boolean
          application/json:
            schema:
              description: >-
                JSON body for POST /api/v1/fonts when uploading a font by URL.
                The

                alternative is a multipart 'file' upload. Send one or the other.
              example:
                url: https://example.com/fonts/MyBrand-Bold.ttf
              properties:
                url:
                  description: Public URL of a TTF or OTF font file to fetch
                  maxLength: 2048
                  minLength: 1
                  title: Url
                  type: string
                license_confirmed:
                  default: false
                  description: >-
                    Confirmation that you have the right to use and embed this
                    font. Required.
                  title: License Confirmed
                  type: boolean
              required:
                - url
              title: FontUploadRequest
              type: object
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FontResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Node.js
          source: >-
            const response = await
            fetch("https://api.sudomock.com/api/v1/fonts", {
              method: "POST",
              headers: {
                "x-api-key": "sm_your_api_key",
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "url": "https://example.com/fonts/MyBrand-Bold.ttf"
              }),
            });


            const data = await response.json();

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

            $payload = <<<'JSON'
            {
              "url": "https://example.com/fonts/MyBrand-Bold.ttf"
            }
            JSON;

            $ch = curl_init("https://api.sudomock.com/api/v1/fonts");
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
            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 = {
                "url": "https://example.com/fonts/MyBrand-Bold.ttf"
            }

            response = requests.post(
                "https://api.sudomock.com/api/v1/fonts",
                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/fonts")

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

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

            request["Content-Type"] = "application/json"


            request.body = <<~JSON
              {
                "url": "https://example.com/fonts/MyBrand-Bold.ttf"
              }
            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  \"url\": \"https://example.com/fonts/MyBrand-Bold.ttf\"\n}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.sudomock.com/api/v1/fonts\", 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 = """
            {
              "url": "https://example.com/fonts/MyBrand-Bold.ttf"
            }
            """;

            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://api.sudomock.com/api/v1/fonts"))
                .header("x-api-key", "sm_your_api_key")
                .header("Content-Type", "application/json")
                .POST(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 = """

            {
              "url": "https://example.com/fonts/MyBrand-Bold.ttf"
            }

            """;


            var request = new HttpRequestMessage(HttpMethod.Post,
            "https://api.sudomock.com/api/v1/fonts");

            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 POST "https://api.sudomock.com/api/v1/fonts" \
              -H "x-api-key: sm_your_api_key" \
              -H "Content-Type: application/json" \
              -d '{
                "url": "https://example.com/fonts/MyBrand-Bold.ttf"
              }'
components:
  schemas:
    FontResponse:
      properties:
        uuid:
          type: string
          description: Font id
          examples:
            - 7f3a2b1c-9d4e-4a6f-b8c2-1e5d7a0c3f94
        family:
          type: string
          description: Font family name, e.g. 'Open Sans'
          examples:
            - Open Sans
        subfamily:
          anyOf:
            - type: string
            - type: 'null'
          description: Style within the family, e.g. 'Bold Italic'
          examples:
            - Regular
        postscript_name:
          type: string
          description: >-
            PostScript name, the stable key used to reference this font when
            rendering text layers
          examples:
            - OpenSans-Regular
        category:
          anyOf:
            - type: string
            - type: 'null'
          description: Catalog category, e.g. 'sans-serif', 'serif', 'display'
          examples:
            - sans-serif
        license:
          anyOf:
            - type: string
            - type: 'null'
          description: License identifier (system fonts)
          examples:
            - OFL
        is_premium:
          type: boolean
          description: Whether this is a premium catalog font
          default: false
        is_system:
          type: boolean
          description: True for the shared system catalog, False for a font you uploaded
          examples:
            - true
        preview_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Legacy rendered preview image, when available; new catalog entries
            no longer include one (use file_url for live previews)
        file_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            URL of the web-optimized WOFF2 file for live @font-face preview: a
            public CDN URL for system fonts, a short-lived link for your own
            uploads. Null for premium fonts; the original TTF/OTF source is
            never exposed.
          examples:
            - >-
              https://cdn.sudomock.com/mockup-assets/fonts/web/7f3a2b1c-9d4e-4a6f-b8c2-1e5d7a0c3f94.woff2
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          description: When the font was added
          examples:
            - '2026-07-13T09:14:22+00:00'
      type: object
      required:
        - uuid
        - family
        - postscript_name
        - is_system
      title: FontResponse
      description: |-
        A single font in the catalog: a shared system font, or one of the
        caller's own uploaded fonts.
      example:
        category: sans-serif
        created_at: '2026-07-13T00:00:00+00:00'
        family: Open Sans
        file_url: >-
          https://cdn.sudomock.com/mockup-assets/fonts/web/9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f.woff2
        is_premium: false
        is_system: true
        license: OFL
        postscript_name: OpenSans-Regular
        subfamily: Regular
        uuid: 9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f
        preview_url: null
  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

````