SudoMock
GET

List Mockups

Retrieve all your uploaded mockup templates with pagination, filtering, and sorting options.

GET/api/v1/mockups

Request

Headers

X-API-KEYstringRequired

Your SudoMock API key starting with sm_

Query Parameters

limitinteger

Number of mockups to return. Default: 20, Max: 100

offsetinteger

Number of mockups to skip for pagination. Default: 0

namestring

Filter by exact mockup name.

created_afterstring

Filter mockups created after this date (ISO 8601 format).

created_beforestring

Filter mockups created before this date (ISO 8601 format).

sortstring

Field to sort by: name, created_at, or updated_at. Default: created_at

orderstring

Sort order: asc or desc. Default: desc

Pagination

Use limit and offset to paginate through results. The response includes total to help calculate total pages.

Code Examples

List Mockups
bash
1# Basic list - first 20 mockups
2curl -X GET "https://api.sudomock.com/api/v1/mockups" \
3 -H "X-API-KEY: sm_your_api_key"
4
5# With pagination
6curl -X GET "https://api.sudomock.com/api/v1/mockups?limit=50&offset=20" \
7 -H "X-API-KEY: sm_your_api_key"
8
9# With filters and sorting
10curl -X GET "https://api.sudomock.com/api/v1/mockups?sort=name&order=asc&created_after=2025-01-01T00:00:00Z" \
11 -H "X-API-KEY: sm_your_api_key"

Response

Success Response

200OK
Response 200 OK
1{
2 "success": true,
3 "data": {
4 "mockups": [
5 {
6 "uuid": "abc123-def456-ghi789",
7 "name": "Product Mockup",
8 "thumbnail": "https://cdn.sudomock.com/abc123/thumbnails/thumb_720.jpg",
9 "width": 3000,
10 "height": 2000,
11 "smart_objects": [
12 {
13 "uuid": "so-uuid-001",
14 "name": "Product Image",
15 "layer_name": "Smart Object 1",
16 "size": { "width": 3000, "height": 3000 },
17 "position": { "x": 100, "y": 100, "width": 800, "height": 600 },
18 "quad": null,
19 "blend_mode": "normal",
20 "print_area_presets": [
21 {
22 "uuid": "preset-uuid-001",
23 "name": "Default",
24 "size": { "width": 3000, "height": 3000 },
25 "position": { "x": 0, "y": 0, "width": 3000, "height": 3000 }
26 }
27 ]
28 }
29 ],
30 "text_layers": [],
31 "collections": [],
32 "thumbnails": [
33 { "width": 720, "url": "https://cdn.sudomock.com/abc123/thumbnails/thumb_720.jpg" },
34 { "width": 480, "url": "https://cdn.sudomock.com/abc123/thumbnails/thumb_480.jpg" },
35 { "width": 240, "url": "https://cdn.sudomock.com/abc123/thumbnails/thumb_240.jpg" }
36 ]
37 }
38 ],
39 "total": 156,
40 "limit": 20,
41 "offset": 0
42 },
43 "message": ""
44}

Response Fields

mockupsarrayRequired

Array of mockup objects.

totalintegerRequired

Total number of mockups matching the query.

limitintegerRequired

The limit that was applied.

offsetintegerRequired

The offset that was applied.

mockups[].uuidstringRequired

Unique identifier for the mockup.

mockups[].namestringRequired

Name of the mockup template.

mockups[].thumbnailstring

URL to the mockup preview image.

mockups[].smart_objectsarrayRequired

List of smart object layers in the mockup.

mockups[].thumbnailsarray

Multiple thumbnail sizes available.

Geometry Data

The quad field (corner coordinates) is only included for Scale tier users. Free and Pro tier users will see quad: null in the response.

Error Responses

401Unauthorized
json
1{
2 "success": false,
3 "detail": "Invalid or missing API key"
4}
500Internal Server Error
json
1{
2 "success": false,
3 "detail": "Internal error while listing mockups"
4}

Pagination Example

Here's how to paginate through all your mockups:

Paginate Through All Mockups
1async function getAllMockups(apiKey) {
2 const allMockups = [];
3 const limit = 100;
4 let offset = 0;
5 let total = null;
6
7 do {
8 const response = await fetch(
9 `https://api.sudomock.com/api/v1/mockups?limit=${limit}&offset=${offset}`,
10 { headers: { "X-API-KEY": apiKey } }
11 );
12
13 const data = await response.json();
14 allMockups.push(...data.data.mockups);
15
16 total = data.data.total;
17 offset += limit;
18
19 } while (offset < total);
20
21 return allMockups;
22}

Try It Live

GET/api/v1/mockups?limit=20&offset=0

List all your mockups with pagination.

Get your API key from the Dashboard

Best Practices

Performance Tips

  • Use limit=100 (max) for bulk operations to minimize API calls
  • Cache the total value and only refetch when adding/removing mockups
  • Store mockup UUIDs locally after initial sync to avoid repeated list calls
  • Use date filters (created_after) for incremental syncs

Common Issues

  • Empty results: Check if your API key has any uploaded mockups
  • Missing mockups: Ensure offset + limit doesn't exceed total
  • Slow response: Reduce limit or add filters for large collections