SudoMock
Integration

Airtable Integration

Connect Airtable to SudoMock and generate mockups automatically when records are added or updated.

Perfect for Product Catalogs

Store designs in Airtable → Trigger mockup generation → Save results back to Airtable

Use Cases

Product Catalog Management

Auto-generate mockups when new designs are added

Team Collaboration

Designers upload, mockups generate automatically

Batch Processing

Update multiple records, generate all mockups at once

E-commerce Sync

Push generated mockups to Shopify/Etsy listings

Integration Methods

There are three ways to connect Airtable with SudoMock:

1. Airtable Automations (No Code)

Use Airtable's built-in automations with "Run a script" action to call SudoMock API.

2. n8n/Zapier/Make

Connect Airtable trigger to SudoMock action in your automation platform of choice.

3. Custom Script

Write a script that reads from Airtable API and calls SudoMock API.

Method 1: Airtable Automations

1

Set Up Your Airtable Base

Create a table with these fields:

  • Design URL (URL) - Link to your design PNG
  • Product Type (Single Select) - T-shirt, Mug, Poster, etc.
  • Mockup URL (URL) - Will store generated mockup
  • Status (Single Select) - Pending, Processing, Done
2

Create Automation

Go to Automations → Create automation → Choose trigger: "When record matches conditions" Set condition: Status = "Pending"

3

Add Script Action

Add action → "Run a script" → Paste this code:

Airtable Automation Script
1// Airtable Automation Script
2// Input variables: designUrl, productType, recordId
3
4const SUDOMOCK_API_KEY = 'YOUR_API_KEY';
5
6// Template UUIDs for each product type
7const TEMPLATES = {
8 't-shirt': { mockup: 'tshirt-uuid', smartObject: 'so-uuid' },
9 'mug': { mockup: 'mug-uuid', smartObject: 'so-uuid' },
10 'poster': { mockup: 'poster-uuid', smartObject: 'so-uuid' }
11};
12
13const template = TEMPLATES[input.productType.toLowerCase()];
14
15if (!template) {
16 throw new Error(`Unknown product type: ${input.productType}`);
17}
18
19// Call SudoMock API
20const response = await fetch('https://api.sudomock.com/api/v1/renders', {
21 method: 'POST',
22 headers: {
23 'X-API-KEY': SUDOMOCK_API_KEY,
24 'Content-Type': 'application/json'
25 },
26 body: JSON.stringify({
27 mockup_uuid: template.mockup,
28 smart_objects: [{
29 uuid: template.smartObject,
30 asset: { url: input.designUrl }
31 }],
32 export_options: {
33 image_format: 'webp',
34 image_size: 2000,
35 quality: 95
36 }
37 })
38});
39
40const result = await response.json();
41
42if (!result.success) {
43 throw new Error(result.detail);
44}
45
46// Return mockup URL to update the record
47output.set('mockupUrl', result.data.print_files[0].export_path);
4

Update Record

Add another action → "Update record" → Set Mockup URL field to script output. Set Status to "Done".

Input Variables

In the script settings, add input variables:
  • designUrl → Map to Design URL field
  • productType → Map to Product Type field
  • recordId → Map to Record ID

Method 2: Using n8n

For more complex workflows, use n8n with Airtable trigger:

n8n Workflow Structure
1// n8n Workflow
21. Airtable Trigger
3 - Table: Products
4 - Trigger On: Record Created
5
62. HTTP Request (SudoMock)
7 - Method: POST
8 - URL: https://api.sudomock.com/api/v1/renders
9 - Headers: X-API-KEY = YOUR_API_KEY
10 - Body: {
11 "mockup_uuid": "{{ $json.product_type_uuid }}",
12 "smart_objects": [{
13 "uuid": "{{ $json.smart_object_uuid }}",
14 "asset": { "url": "{{ $json.Design_URL }}" }
15 }]
16 }
17
183. Airtable Update
19 - Record ID: {{ $('Airtable Trigger').item.json.id }}
20 - Fields: { "Mockup_URL": "{{ $json.data.print_files[0].export_path }}" }

Method 3: Custom Script

For full control, use a script that processes all pending records:

Batch Processing Script
1import Airtable from 'airtable';
2
3const base = new Airtable({ apiKey: process.env.AIRTABLE_API_KEY })
4 .base(process.env.AIRTABLE_BASE_ID);
5
6const SUDOMOCK_API_KEY = process.env.SUDOMOCK_API_KEY;
7
8async function processPendingRecords() {
9 // Get all pending records
10 const records = await base('Products')
11 .select({
12 filterByFormula: "{Status} = 'Pending'",
13 maxRecords: 50
14 })
15 .all();
16
17 console.log(`Processing ${records.length} records...`);
18
19 for (const record of records) {
20 try {
21 // Update status to Processing
22 await record.updateFields({ Status: 'Processing' });
23
24 // Generate mockup
25 const response = await fetch('https://api.sudomock.com/api/v1/renders', {
26 method: 'POST',
27 headers: {
28 'X-API-KEY': SUDOMOCK_API_KEY,
29 'Content-Type': 'application/json'
30 },
31 body: JSON.stringify({
32 mockup_uuid: getTemplateUuid(record.get('Product Type')),
33 smart_objects: [{
34 uuid: getSmartObjectUuid(record.get('Product Type')),
35 asset: { url: record.get('Design URL') }
36 }]
37 })
38 });
39
40 const result = await response.json();
41
42 if (result.success) {
43 await record.updateFields({
44 'Mockup URL': result.data.print_files[0].export_path,
45 Status: 'Done'
46 });
47 console.log(`${record.id}`);
48 } else {
49 throw new Error(result.detail);
50 }
51
52 } catch (error) {
53 await record.updateFields({
54 Status: 'Error',
55 Notes: error.message
56 });
57 console.error(`${record.id}: ${error.message}`);
58 }
59
60 // Respect rate limits
61 await new Promise(r => setTimeout(r, 500));
62 }
63}
64
65processPendingRecords();

Ready to Connect Airtable?

Get your API key and start generating mockups from your Airtable base.