Developers

Your galleries, anywhere

Show real galleries on your website, bring client favorites into Lightroom, or build your own tools. Every Terracotta account can create API keys, free.

Get started

Three steps

  1. In your dashboard, open Developers → API keys and pick what you want to connect. The setup wizard creates a key with the right permissions.
  2. Copy the key. It's shown once; if you lose it, revoke it and make another.
  3. Send it with each request, from a server, never from a public web page:
curl https://terracottagalleries.com/api/v1/me \
  -H "Authorization: Bearer tc_live_…"

Website embed

Your galleries on any website, no code

Paste two lines into your site and visitors see a real gallery (grid, masonry or carousel, with a lightbox) or your portfolio of recent galleries, always up to date. It works on WordPress, Squarespace, Wix, Showit and plain HTML, with no server.

  1. In your dashboard, open Developers → API keys → New API key → Website embed.
  2. Type your website's address, pick a gallery (or your portfolio) and a layout. You'll see a live preview.
  3. Copy the snippet and paste it into your site (guides below).
<!-- One gallery -->
<div data-terracotta-gallery="GALLERY_ID" data-key="tc_pub_…" data-layout="grid"></div>

<!-- Or your portfolio: recent galleries as cover cards -->
<div data-terracotta-portfolio data-key="tc_pub_…"></div>

<!-- Or a blog post (published or unlisted ones are public: no key) -->
<div data-terracotta-blog="POST_ID"></div>

<script src="https://terracottagalleries.com/embed.js" async></script>

Options

  • data-layout: grid (even squares), masonry (whole photos, staggered) or carousel (one row that scrolls).
  • data-limit: how many photos (up to 100, 60 by default), or galleries in a portfolio (up to 48, 12 by default).
  • data-title="false" hides the gallery's title; data-link="false" hides “View the full gallery”.
  • The script is loaded once per page, however many galleries it shows. It uses your site's font and text color and nothing else from your site's styles.

What it shows (and never shows)

Only galleries anyone with the link could open: published, not expired, Public (or Unlisted ones you picked for the key), with no password, client list or email sign-in, and not in sneak-peek mode. Only photos your clients see, at web sizes, watermarked if the gallery is. Never originals, hidden photos, favorites, filenames or anything about your clients.

WordPress

  1. Edit the page, click + and add a Custom HTML block.
  2. Paste the snippet. Click Preview in the block to see it, then Update.

Classic editor: switch to the Text tab and paste. WordPress.com sites need a plan that allows custom HTML.

Squarespace

  1. Edit the page, add a block and choose Code.
  2. Paste the snippet, keep the mode on HTML, and save.

The editor may show a placeholder; view the live page to see the gallery. To see it while editing too, add *.squarespace.com to the key's websites.

Wix

  1. Click Add Elements → Embed Code → Embed HTML.
  2. Choose Code, paste the snippet, Update, and drag the box to the size you want.

Wix runs embedded code from its own address, so add *.filesusr.com to the key's websites (Dashboard → Developers, in your key list).

Showit

  1. Add an Embed Code element to the canvas where you want the photos.
  2. Paste the snippet in the right-hand panel, size the element, and publish.

Showit shows embeds on the published site, not on the canvas. Previewing on your showit.site address? Add *.showit.site to the key's websites.

Any HTML page

Paste the <div> where the photos go and the <script> anywhere after it (or once, before </body>). To try it on your computer, keep localhost in the key's websites. Pages that build themselves in the browser can call Terracotta.load() after adding a new <div>.

Nothing shows? Open your browser's console: the embed says why, e.g. the site isn't on the key's list or the gallery isn't public. Check the address in Dashboard → Developers matches the site exactly (www. included; the wizard adds both).

Keys & permissions

Secret keys and publishable keys

There are two kinds of key:

  • Publishable keys (tc_pub_…) are for the website embed. They're safe in a web page: read-only, they see only what anyone with a gallery's link could see, and they only work on the websites you list (checked against the browser's Origin). You can view them again in your dashboard. Requests: GET /api/v1/embed/galleries (portfolio), GET /api/v1/embed/galleries/{id} and GET /api/v1/reviews (published reviews), with ?key=.
  • Secret keys (tc_live_…) reach everything below, so they belong on a server. They're shown once.

Secret keys start with tc_live_. Send one as Authorization: Bearer … (or X-API-Key). Anyone with a key can read what it allows, so keep keys in server code or private settings. The API doesn't answer browsers on other websites, so a key pasted into a public page won't work there.

  • Galleries & photos (read): every key has this. It also reads your blog posts.
  • Client favorites (favorites): which photos clients loved, with their names, emails and notes. Turn it on only for tools that need it.
  • Create & upload (write): make galleries, upload photos and remove them. Lightroom publishing uses this.
  • Webhooks & automations (webhooks): subscribe to events, for Zapier, Make and your own code (webhooks).
  • Portfolio (portfolio:read): your portfolio's galleries and the photos you picked for them, with image links that don't expire, for your own website (guide).
  • Reviews (reviews:read): your published reviews and average rating, for your own website (guide).

Revoking a key in your dashboard stops it on the very next request. Your dashboard shows when each key was last used.

API reference

terracottagalleries.com/api/v1

GET/meneeds read

Who the key belongs to and what it may do.

→ { "studio": { "name", "slug", "galleries" }, "key": { "scopes": ["read"] } }

GET/galleriesneeds read

Your galleries, newest first.

status=draft|live|cellar · limit=1–100 · cursor

→ { "data": [Gallery], "next": "cursor or null" }

GET/galleries/{id}needs read

One gallery.

→ Gallery

GET/galleries/{id}/photosneeds read

The gallery's photos in gallery order, with image links. Hidden and sneak-peek photos included, flagged.

scene · limit · cursor

→ { "data": [Photo], "next" }

GET/photos/{id}needs read

One photo with fresh image links.

→ Photo

GET/galleries/{id}/favoritesneeds favorites

Every favorites list in a gallery: who made it, and its photos with notes.

→ { "data": [{ "id", "name", "client": { "name", "email" }, "photos": [{ "photo_id", "filename", "note", "favorited_at" }] }] }

POST/galleriesneeds write

A new draft gallery, built from your default gallery like ones made in the dashboard.

{ "title": "…", "event_date": "2026-10-10" }

→ Gallery (201)

POST/galleries/{id}/uploadsneeds write

Starts an upload: you get storage links to send the file to, in pieces.

{ "filename", "content_type": "image/jpeg", "bytes" }

→ { "photo_id", "upload_id", "part_bytes", "urls": [...] } (201)

POST/uploads/{photo_id}/completeneeds write

Finishes an upload. The photo appears once processed, usually within seconds.

{ "upload_id", "parts": [{ "n": 1, "etag": "…" }] }

→ { "photo_id", "status": "processing" }

DELETE/photos/{id}needs write

Removes a photo for good (files and storage billing), like deleting it in the dashboard.

→ { "id", "deleted": true }

GET/portfolioneeds portfolio:read

Your portfolio: its title, introduction and galleries in portfolio order (hidden ones left out), each with a cover and how many photos it shows. Image links never expire.

→ { "title", "intro", "published", "updated_at", "galleries": [PortfolioGallery] }

GET/portfolio/galleries/{id or slug}needs portfolio:read

One portfolio gallery and only the photos you picked for it, in your order, with links at four sizes. 404 when it isn't on your published portfolio.

→ PortfolioGallery & { "photos": [PortfolioPhoto] }

GET/reviewsneeds reviews:read

Your published reviews (only ones you approved and the client agreed to share), featured first then newest, with the average rating and count of all of them. Also works from a browser with a publishable key (?key=tc_pub_…), on the key's sites.

limit=1–100 (20) · min_rating=1–5 · gallery={id or slug}

→ { "average", "count", "reviews": [Review] }

GET/blog/postsneeds read

Your blog posts, most recently changed first, drafts included unless you filter. Each with its cover; image links never expire.

status=draft|published|unlisted · limit=1–100 · cursor

→ { "data": [BlogPostSummary], "next" }

GET/blog/posts/{id}needs read

One blog post in full: every photo, the blocks, and the body as clean HTML (the same HTML the RSS feed carries).

→ BlogPostSummary & { "photos": [BlogPhoto], "blocks": [Block], "html", "blog_url" }

GET/favoritesneeds favorites

Every favorite across your galleries, oldest first, with filenames.

since=ISO date · gallery={id} · limit · cursor

→ { "data": [{ "gallery_id", "photo_id", "filename", "list", "client", "note", "favorited_at" }], "next" }

POST/webhooksneeds webhooks

Subscribes a URL to events (REST hooks: Zapier, Make, your own code). The answer has the signing secret, shown once.

{ "url": "https://…", "events": ["gallery.published"] }

→ { "id", "url", "events", "include_client", "active", "created_at", "secret" } (201)

GET/webhooksneeds webhooks

Your webhook endpoints, without secrets.

→ { "data": [{ "id", "url", "events", "active", … }] }

DELETE/webhooks/{id}needs webhooks

Unsubscribes.

→ { "id", "deleted": true }

GET/eventsneeds read

The latest events of one type, rebuilt from your data in webhook shape: sample data for trigger editors, or polling.

type=gallery.published|favorites.submitted|photo.ready|gallery.created|portfolio.updated|review.submitted|review.published · limit=1–25

→ { "data": [Event] }

Gallery

{
  "id": "8be729e1-fca8-421f-a106-b78cd89199bf",
  "title": "The Weaver Wedding",
  "status": "live",
  "url": "https://clients.yourstudio.com/g/the-weaver-wedding-8be729e1",
  "event_date": "2026-10-10",
  "created_at": "2026-10-11T18:02:11Z",
  "published_at": "2026-10-12T05:48:52Z",
  "cover_photo_id": "…",
  "scenes": [{ "id": "a1b2", "name": "Ceremony" }],
  "photo_count": 67
}

Photo

{
  "id": "…",
  "gallery_id": "…",
  "filename": "WEAVER_0412.jpg",
  "kind": "photo",
  "width": 6000, "height": 4000,
  "taken_at": "2026-10-10T17:42:05Z",
  "position": 12,
  "scene_id": "a1b2",
  "sneak_peek": true,
  "hidden_from_clients": false,
  "images": {
    "small": "https://…/w400.webp?…",
    "medium": "https://…/w1000.webp?…",
    "large": "https://…/w2000.webp?…",
    "large_jpeg": "https://…/w2000.jpg?…",
    "expires_at": "2026-10-12T19:00:00Z"
  }
}

Uploading a photo

# 1. Start: storage links come back, one per piece of the file
curl -X POST https://terracottagalleries.com/api/v1/galleries/GALLERY_ID/uploads -H "Authorization: Bearer tc_live_…" \
  -H "Content-Type: application/json" -d '{"filename":"IMG_0412.jpg","content_type":"image/jpeg","bytes":4818231}'

# 2. PUT each piece (part_bytes long, in order) to its URL and keep the ETag header it answers with
curl -X PUT --data-binary @piece-1 "URL_1" -D - | grep -i etag

# 3. Finish
curl -X POST https://terracottagalleries.com/api/v1/uploads/PHOTO_ID/complete -H "Authorization: Bearer tc_live_…" \
  -H "Content-Type: application/json" -d '{"upload_id":"UPLOAD_ID","parts":[{"n":1,"etag":"\"9b2cf…\""}]}'

Files go straight to storage, never through our servers, so big photos upload fast. Uploads past your free storage without a card on file are refused with 402 card_needed; nothing already stored is affected.

Image links last an hour (see expires_at), the same as the links your clients get. Fetch them when your page builds or renders, or copy the images to your own hosting. Don't save the links themselves.

Pages: lists return up to limit items (50 by default, 100 at most) and a next cursor. Pass it as cursor for the next page; it's null on the last one.

Errors & limits

When something goes wrong

Errors come back with an HTTP status and a message written for people:

{ "error": { "code": "forbidden", "message": "This key doesn't have the \"favorites\" permission. …" } }
  • 401 unauthorized: missing, unknown or revoked key.
  • 403 forbidden: the key doesn't have that permission.
  • 404 not_found: not yours, or doesn't exist.
  • 400 bad_request: a parameter isn't valid; the message says which.
  • 402 card_needed / limit_reached / past_due: uploads are paused for your account; the message says how to fix it.
  • 429 rate_limited: over 120 requests a minute per key. Wait for Retry-After seconds.

Webhooks

Get told when things happen

Add an endpoint in Dashboard → Developers → Webhooks (a URL and the events you want) and Terracotta sends it a signed POST each time one happens. You get a signing secret once, when you add it; keep it with your server's other secrets.

gallery.published

A gallery goes live for clients.

data: { "gallery": Gallery }

favorites.submitted

A client sends you their favorites list.

data: { "gallery": Gallery, "list": { "id", "name", "submitted_at" }, "client": { "name", "email" } | null, "photos": [{ "photo_id", "filename", "note", "favorited_at" }], "count" }

photo.ready

Uploaded photos finish processing (one event per gallery per batch).

data: { "gallery": Gallery, "photos": [Photo], "count" }

gallery.created

A new gallery is made, in the dashboard, by the importer or through the API.

data: { "gallery": Gallery }

portfolio.updated

Your portfolio's galleries, picked photos or words change (so your website can refresh).

data: { "reason": "photos" | "galleries" | "settings" | "best_of", "gallery_id" | null, "updated_at", "portfolio_url", "gallery_url" | null }

review.submitted

A client leaves you a review (on your review page or from a request). It's pending until you publish it.

data: { "review": Review, "client": { "name", "email" } | null }

review.published

You publish a review (so your website can refresh).

data: { "review": Review, "client": { "name", "email" } | null }

blog.published

A blog post goes live (published, or shared as unlisted).

data: { "post": { "id", "slug", "title", "status", "url", "canonical_url", "published_at", "updated_at", "cover_url" }, "api_url" }

blog.updated

You change a live blog post (at most one event a minute while you edit, so your website can refresh).

data: { "post": { …same as blog.published }, "api_url" }

blog.unpublished

A live blog post goes back to draft or is deleted.

data: { "post": { "id", "slug", "title", "status": "draft", "url": null, … }, "api_url" }

  • Every body is { "id", "type", "created_at", "data" }. Gallery and Photo are exactly what the API returns.
  • favorites.submitted goes out when a client presses “Send to your photographer” on a favorites list. client is null unless the endpoint opted in to client names and emails (for API subscriptions: the key has the favorites permission), like the favorites API.
  • photo.ready is batched so a 500-photo upload doesn't make 500 calls: once a gallery has had no newly finished photos for 60 seconds (or every 5 minutes during a long upload), you get one event with up to 100 photos. Bigger batches come as several events. Image links in it expire an hour after the event; get fresh ones from GET /photos/{id}.
  • portfolio.updated goes out when your portfolio's galleries, picked photos, order or words change. It only says what changed: fetch the portfolio API again, or revalidate the pages built from it.
  • review.submitted goes out when a client leaves a review (on your review page, from an emailed request or a personal link); review.published when you publish one. Review is { "id", "status": "pending" | "published" | "hidden", "source": "link" | "email" | "token", "rating", "body", "display_name", "publish_ok", "featured", "reply", "gallery": { "id", "title", "slug" } | null, "session", "submitted_at", "published_at" }. A pending review isn't public: don't show it until it's published. client follows the same opt-in as favorites.
  • The same event to several endpoints has the same id. Deliveries can repeat or arrive out of order: skip ids you've already handled.
POST /your/webhook HTTP/1.1
Content-Type: application/json
User-Agent: Terracotta-Webhooks/1.0
Terracotta-Event: favorites.submitted
Terracotta-Delivery: 5b0f8c1e-…
Terracotta-Signature: t=1760245800,v1=6f1c0e…

{
  "id": "evt_k2m9x4q7r1t8w3z6c5v0b2n4",
  "type": "favorites.submitted",
  "created_at": "2026-10-12T05:50:00.000Z",
  "data": {
    "gallery": { "id": "8be729e1-…", "title": "The Weaver Wedding", "status": "live", "url": "https://…", … },
    "list": { "id": "…", "name": "Favorites", "submitted_at": "2026-10-12T05:50:00.000Z" },
    "client": { "name": "Leah Weaver", "email": "leah@example.com" },
    "photos": [
      { "photo_id": "…", "filename": "WEAVER_0412.jpg", "note": "Black and white?", "favorited_at": "2026-10-12T05:41:09.000Z" }
    ],
    "count": 1
  }
}

Check the signature

Terracotta-Signature is t=<unix seconds>,v1=<hex>, where v1 is an HMAC-SHA256 of t + "." + the raw body with your endpoint's secret (the whole whsec_… string). Compare in constant time, and refuse timestamps more than 5 minutes off so a captured request can't be replayed. Use the raw body, before any JSON parsing.

Node.js

// Express: keep the raw body, the signature is over the exact bytes.
import crypto from "node:crypto"
import express from "express"

const app = express()
app.post("/terracotta", express.raw({ type: "application/json" }), (req, res) => {
  const raw = req.body.toString("utf8")
  const header = req.get("Terracotta-Signature") ?? ""
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")))
  const expected = crypto.createHmac("sha256", process.env.TERRACOTTA_WEBHOOK_SECRET)
    .update(`${parts.t}.${raw}`).digest("hex")
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300
  const ok = fresh && parts.v1?.length === 64 &&
    crypto.timingSafeEqual(Buffer.from(parts.v1, "hex"), Buffer.from(expected, "hex"))
  if (!ok) return res.status(400).send("bad signature")

  const event = JSON.parse(raw)
  // Answer quickly; do slow work afterwards. Skip ids you've already handled.
  res.sendStatus(200)
  if (event.type === "favorites.submitted") { /* … */ }
})

PHP

<?php
$raw = file_get_contents("php://input");
$header = $_SERVER["HTTP_TERRACOTTA_SIGNATURE"] ?? "";
parse_str(str_replace(",", "&", $header), $parts); // t=…&v1=…
$expected = hash_hmac("sha256", $parts["t"] . "." . $raw, getenv("TERRACOTTA_WEBHOOK_SECRET"));
if (abs(time() - (int) $parts["t"]) > 300 || !hash_equals($expected, $parts["v1"] ?? "")) {
  http_response_code(400);
  exit("bad signature");
}
$event = json_decode($raw, true);
http_response_code(200);
// $event["type"], $event["data"] …

Python

# Flask
import hashlib, hmac, os, time
from flask import Flask, request, abort

app = Flask(__name__)

@app.post("/terracotta")
def terracotta():
    raw = request.get_data()  # bytes, exactly as sent
    parts = dict(p.split("=", 1) for p in request.headers.get("Terracotta-Signature", "").split(",") if "=" in p)
    signed = parts.get("t", "").encode() + b"." + raw
    expected = hmac.new(os.environ["TERRACOTTA_WEBHOOK_SECRET"].encode(), signed, hashlib.sha256).hexdigest()
    if abs(time.time() - int(parts.get("t", 0))) > 300 or not hmac.compare_digest(expected, parts.get("v1", "")):
        abort(400)
    event = request.get_json()
    return "", 200

Retries and failures

  • Answer with any 2xx within 10 seconds. Anything else, a timeout or a redirect (redirects aren't followed) counts as a failure.
  • Failures are retried 5 times: after about 1 minute, 10 minutes, 1 hour, 4 hours and 18 hours (6 attempts over roughly a day).
  • If a delivery fails every attempt and nothing else reached the endpoint meanwhile, the endpoint is turned off and you get an email. Turn it back on in your dashboard once it's fixed.
  • Answering 410 Gone turns the endpoint off at once (that's how Zapier says a Zap was switched off).
  • Your dashboard shows recent deliveries with the answer your server gave, and can resend any of them or send a test event (webhook.test).
  • Endpoints must be public https:// URLs. Private and internal addresses are refused, when you save the URL and again when we connect.

Subscribing from code (REST hooks)

Tools can add and remove their own endpoints with a key that has the webhooks permission. That's what Zapier and Make do.

curl -X POST https://terracottagalleries.com/api/v1/webhooks -H "Authorization: Bearer tc_live_…" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/terracotta","events":["gallery.published","favorites.submitted"]}'
# → 201 { "id": "…", "secret": "whsec_…", … }

curl -X DELETE https://terracottagalleries.com/api/v1/webhooks/WEBHOOK_ID -H "Authorization: Bearer tc_live_…"

# Sample data in webhook shape (or polling):
curl "https://terracottagalleries.com/api/v1/events?type=favorites.submitted&limit=3" -H "Authorization: Bearer tc_live_…"

Guide

Show your galleries on your website

The idea: your website's server asks Terracotta for your published galleries and their photos, then shows them in your own design. A good fit for a portfolio page or a “recent work” section.

  1. Create a key with the wizard: choose My website's server (API).
  2. Save it as a private setting (an environment variable like TERRACOTTA_KEY) on your host.
  3. Fetch on the server and render:

Next.js (or any JavaScript server)

// app/portfolio/page.tsx: refreshed at most every 10 minutes
const headers = { Authorization: `Bearer ${process.env.TERRACOTTA_KEY}` }

export default async function Portfolio() {
  const { data: galleries } = await fetch("https://terracottagalleries.com/api/v1/galleries?status=live&limit=12", { headers, next: { revalidate: 600 } }).then((r) => r.json())
  const covers = await Promise.all(
    galleries.map((g) => fetch(`https://terracottagalleries.com/api/v1/photos/${g.cover_photo_id}`, { headers, next: { revalidate: 600 } }).then((r) => r.json())),
  )
  return galleries.map((g, i) => (
    <a key={g.id} href={g.url}><img src={covers[i].images?.medium} alt={g.title} /> {g.title}</a>
  ))
}

WordPress (PHP, in your theme or a snippets plugin)

$res = wp_remote_get("https://terracottagalleries.com/api/v1/galleries?status=live", [
  "headers" => ["Authorization" => "Bearer " . TERRACOTTA_KEY], // define TERRACOTTA_KEY in wp-config.php
]);
$galleries = json_decode(wp_remote_retrieve_body($res), true)["data"] ?? [];
foreach ($galleries as $g) {
  echo '<a href="' . esc_url($g["url"]) . '">' . esc_html($g["title"]) . '</a>';
}

Squarespace, Wix and Showit can't keep a secret key private: use the website embed and its publishable key instead.

Guide

Your portfolio on your own website

Portfolio and reviews are part of Terracotta Studio, the optional add-on. Their endpoints, permissions and webhooks work for studios that have it.

Keep your website exactly as it looks, and let Terracotta hold the photos. In Terracotta Studio → Website → Portfolio you choose the galleries, the photos each one shows, their order and cover; your site fetches that and renders the pages itself. Only the photos you picked are ever returned, even from a Private or password-protected gallery, and never its client link, password or downloads.

  1. In Developers → API keys, choose My portfolio on my website (API). The key gets the portfolio:read permission.
  2. Save it on your host as a private setting, e.g. TERRACOTTA_KEY.
  3. Fetch on the server (or at build time) and render with your own components:
// lib/terracotta.ts: server-only (the key never reaches the browser)
const API = "https://terracottagalleries.com/api/v1"

async function terracotta<T>(path: string): Promise<T> {
  const res = await fetch(API + path, {
    headers: { Authorization: `Bearer ${process.env.TERRACOTTA_KEY}` },
    next: { revalidate: 3600, tags: ["portfolio"] }, // ISR: at most hourly, or on the webhook below
  })
  if (!res.ok) throw new Error(`Terracotta ${res.status}`)
  return res.json()
}

export const getPortfolio = () => terracotta<Portfolio>("/portfolio")
export const getPortfolioGallery = (slug: string) => terracotta<PortfolioGallery>(`/portfolio/galleries/${slug}`)

// app/work/[slug]/page.tsx
import Image from "next/image"

export async function generateStaticParams() {
  const { galleries } = await getPortfolio()
  return galleries.map((g) => ({ slug: g.slug }))
}

export default async function Work({ params }: { params: Promise<{ slug: string }> }) {
  const gallery = await getPortfolioGallery((await params).slug)
  return gallery.photos.map((p) => (
    <Image key={p.id} src={p.urls.lg} width={p.width} height={p.height} alt={p.alt}
      sizes="(min-width: 1024px) 50vw, 100vw" style={{ objectPosition: `${p.focal.x}% ${p.focal.y}%` }} />
  ))
}

next.config: allow the image host

// next.config.ts
images: {
  remotePatterns: [{ protocol: "https", hostname: "terracottagalleries.com", pathname: "/portfolio-media/**" }],
},

Image links don't expire. Each photo has urls.sm (400 px on the long side), md (1000), lg (2000, WebP) and xl (2000, JPEG), plus the photo's width and height and each size's exact dimensions in sizes, so next/image can lay them out with no shift. The links are cached for an hour by browsers and CDNs; when you take a photo off your portfolio, its link stops working (within that hour everywhere, immediately for new requests). If a gallery is watermarked, its photos are served watermarked, and a new watermark changes the links (?v=). focal is the point to keep in view when cropping, in percent.

Keeping pages fresh: both answers carry an ETag and updated_at (send If-None-Match for a cheap 304). Revalidate on a timer, or subscribe a webhook to portfolio.updated and revalidate when you change something:

// app/api/terracotta/route.ts: point a portfolio.updated webhook here (Dashboard → Developers → Webhooks)
import { createHmac, timingSafeEqual } from "node:crypto"
import { revalidateTag } from "next/cache"

export async function POST(req: Request) {
  const body = await req.text()
  const [t, v1] = (req.headers.get("terracotta-signature") ?? "").split(",").map((x) => x.split("=")[1])
  const want = createHmac("sha256", process.env.TERRACOTTA_WEBHOOK_SECRET!).update(`${t}.${body}`).digest("hex")
  if (!v1 || v1.length !== want.length || !timingSafeEqual(Buffer.from(v1), Buffer.from(want))) return new Response("bad signature", { status: 401 })
  revalidateTag("portfolio", "max")
  return Response.json({ ok: true })
}

GET /portfolio

{
  "title": "Fern & Field Photography",
  "intro": "Wedding and family photographer in the Pacific Northwest.",
  "published": true,
  "updated_at": "2026-10-23T17:04:12.000Z",
  "galleries": [
    {
      "id": "8be729e1-fca8-421f-a106-b78cd89199bf",
      "slug": "fern-oak",
      "title": "Fern & Oak",
      "category": "Weddings",
      "date": "2026-09-27",
      "description": "An October wedding under the ridge.",
      "featured": true,
      "cover": {
        "id": "3f0c…",
        "url": "https://terracottagalleries.com/portfolio-media/3f0c…/lg",
        "width": 6960, "height": 4640,
        "focal": { "x": 50, "y": 38 },
        "urls": { "sm": "…/sm", "md": "…/md", "lg": "…/lg", "xl": "…/xl" },
        "sizes": { "sm": { "width": 400, "height": 267 }, "md": { … }, "lg": { … }, "xl": { … } }
      },
      "photo_count": 24,
      "updated_at": "2026-10-23T17:04:12.000Z"
    }
  ]
}

GET /portfolio/galleries/fern-oak

{
  "id": "8be729e1-…", "slug": "fern-oak", "title": "Fern & Oak", "category": "Weddings",
  "date": "2026-09-27", "description": "…", "featured": true, "cover": { … },
  "photo_count": 24, "updated_at": "2026-10-23T17:04:12.000Z",
  "photos": [
    {
      "id": "3f0c…", "position": 0, "width": 6960, "height": 4640,
      "alt": "Photo 1 from Fern & Oak", "caption": null,
      "focal": { "x": 50, "y": 38 },
      "urls": {
        "sm": "https://terracottagalleries.com/portfolio-media/3f0c…/sm",
        "md": "https://terracottagalleries.com/portfolio-media/3f0c…/md",
        "lg": "https://terracottagalleries.com/portfolio-media/3f0c…/lg",
        "xl": "https://terracottagalleries.com/portfolio-media/3f0c…/xl"
      },
      "sizes": { "sm": { "width": 400, "height": 267 }, "md": { "width": 1000, "height": 667 }, "lg": { "width": 2000, "height": 1333 }, "xl": { "width": 2000, "height": 1333 } }
    }
  ]
}

Galleries come in your portfolio's order; featured marks the ones you starred, category is the group you gave them. A switched-off portfolio answers "published": false with no galleries. The portfolio's own password protects its page on Terracotta; the API (your key) and your website aren't behind it. 120 requests a minute per key, like the rest of the API.

Guide

Your reviews on your own website

Show what clients say, in your site's own design. Clients leave reviews on your review page (Terracotta Studio → Website → Reviews has the link and a QR code) or from a request you email them. Nothing is public until you publish it, and you can only publish a review the client agreed to share. The API returns only those: never the client's email or full name (just the name they chose to show), never pending or hidden reviews.

  1. In Developers → API keys, choose My reviews on my website (API). The key gets the reviews:read permission.
  2. Save it on your host as a private setting, e.g. TERRACOTTA_KEY.
  3. Fetch on the server and render with your own components:
// components/reviews.tsx: a server component (the key never reaches the browser)
type Review = {
  id: string
  display_name: string
  /** null when your review form doesn't ask for stars (or they skipped an optional rating) */
  rating: number | null
  /** null when your review form doesn't ask for words (or they skipped them) */
  body: string | null
  reply: string | null
  gallery: { title: string; slug: string | null } | null
  featured: boolean
  published_at: string
  /** Your own questions you marked "Show publicly", by question id. */
  answers: Record<string, { label: string; value: string | boolean | string[] }>
}

async function getReviews(): Promise<{ average: number | null; count: number; reviews: Review[] }> {
  const res = await fetch("https://terracottagalleries.com/api/v1/reviews?limit=6&min_rating=4", {
    headers: { Authorization: `Bearer ${process.env.TERRACOTTA_KEY}` },
    next: { revalidate: 3600, tags: ["reviews"] }, // at most hourly, or on the review.published webhook
  })
  if (!res.ok) throw new Error(`Terracotta ${res.status}`)
  return res.json()
}

export async function Reviews() {
  const { average, count, reviews } = await getReviews()
  return (
    <section>
      {average != null && <p>{average.toFixed(1)} ★ from {count} reviews</p>}
      {reviews.map((r) => (
        <figure key={r.id}>
          {r.rating != null && <p aria-label={`${r.rating} out of 5 stars`}>{"★".repeat(r.rating)}</p>}
          {r.body && <blockquote>{r.body}</blockquote>}
          <figcaption>{r.display_name}{r.gallery ? `, ${r.gallery.title}` : ""}</figcaption>
          {r.reply && <p>Reply: {r.reply}</p>}
        </figure>
      ))}
    </section>
  )
}

Order and filters: featured reviews (the ones you pinned) come first, then the newest published. limit (1–100, default 20), min_rating (1–5) and gallery (a gallery's id or slug) narrow the list; average and count always cover all your published reviews, so a “4.9 from 37 reviews” line stays honest. rating and body can each be null: your own review form can leave out the stars or the written review (or make them optional), so check before drawing stars or quotes. average only counts reviews with stars. reply is your public answer, or null. answers holds the client's answers to your own questions (from your review form) that you marked “Show publicly”, keyed by the question's id, which stays the same when you rename it; it's when there are none. To refresh the moment you publish one, subscribe a webhook to review.published and call revalidateTag("reviews", "max").

From a browser, with a publishable key

<!-- No server? A publishable key (tc_pub_…) works from the page itself, on the key's sites. -->
<div id="reviews"></div>
<script>
  fetch("https://terracottagalleries.com/api/v1/reviews?limit=6&key=tc_pub_…")
    .then((r) => r.json())
    .then(({ average, count, reviews }) => {
      const box = document.getElementById("reviews")
      for (const r of reviews) {
        const p = document.createElement("p")
        p.textContent = "★".repeat(r.rating || 0) + " " + (r.body || "") + " — " + r.display_name // text, never HTML; rating and body may be null
        box.append(p)
      }
    })
</script>

Published reviews are public already (your portfolio shows them), so any of your publishable keys can read them, from the websites listed on the key. Insert reviews as text, never as HTML. The no-code widget is still there too: Terracotta Studio → Website → Reviews → “Show reviews on your website”.

GET /reviews

{
  "average": 4.9,
  "count": 37,
  "reviews": [
    {
      "id": "5d0c6a7e-0f39-4f8e-9d0a-7f7b1e2c9a10",
      "display_name": "Maya & Theo",
      "rating": 5,
      "body": "We cried looking through our gallery. Every photo feels like the day felt.",
      "reply": "Thank you both. It was a joy!",
      "gallery": { "title": "Maya & Theo's Wedding", "slug": "maya-theo-wedding" },
      "featured": true,
      "published_at": "2026-10-20T16:04:00.000Z",
      "answers": {
        "b4k2m9x": { "label": "A favorite moment from the day", "value": "The first look by the water" },
        "b7q1z3d": { "label": "Would you recommend us to a friend?", "value": true }
      }
    }
  ]
}

Guide

Your blog on any website

Every blog post can live on your own website too, whatever it's built with. In the post's editor, open Share → Copy embed code. There are two kinds:

  • Searchable HTML (recommended): the post's real headings, words, photos (with alt text, width and height) and vendor credits, so search engines read them as part of your page, plus the script, which only adds the photo viewer. Its styles are scoped to one class of its own, so nothing on your site changes. It's a copy: after you edit the post, copy it again.
  • Script only: an empty box the script fills from GET /api/v1/embed/blog/{id}, in a Shadow DOM, always the latest version. For sites that strip HTML; search engines mostly see the box.
<!-- Searchable HTML (recommended): the post's words and photos are part of your page -->
<div class="sb tcb-8be729e1fca8" data-terracotta-blog="POST_ID" …>
  <style>/* the post's look, scoped to .tcb-8be729e1fca8 only */</style>
  <article> … <h1>Fern &amp; Oak: a windy ridge wedding</h1> … <img src="…/blog-media/…/fern-oak-ceremony-1000.webp" alt="…" width="2000" height="1333"> … </article>
</div>
<script src="https://terracottagalleries.com/embed.js" async></script>

<!-- Script only: an empty box the script fills (in a Shadow DOM), always the latest version -->
<div data-terracotta-blog="POST_ID"></div>
<script src="https://terracottagalleries.com/embed.js" async></script>

Paste it where the gallery embed goes on each site builder (WordPress Custom HTML, Showit Embed Code, Squarespace Code, Wix Embed HTML, or any site builder's HTML or embed block). Only published and unlisted posts show; a draft's box says it can't be shown. Photo links are on your own domain when you've connected one, and never expire. Pasting the searchable version on your own site? Set the post's original address (SEO → canonical) to that page, so search engines credit your site rather than the Terracotta copy.

The API

GET /api/v1/blog/posts and GET /api/v1/blog/posts/{id} (any secret key: the read permission) list your posts and return one in full, with its body as clean HTML. Subscribe a webhook to blog.published, blog.updated (at most once a minute while you edit) and blog.unpublished to rebuild your pages when something changes. Your blog also has an RSS feed with every post in full (/blog/feed.xml on your domain, or /stories/YOUR_NAME/feed.xml).

GET /blog/posts/{id}

{
  "id": "8be729e1-fca8-421f-a106-b78cd89199bf",
  "slug": "fern-and-oak-ridgeline-lodge-wedding",
  "title": "Fern & Oak: a windy ridge wedding",
  "subtitle": "A September day at Ridgeline Lodge",
  "location": "Bend, Oregon",
  "shot_on": "2026-09-27",
  "status": "published",
  "url": "https://yourstudio.com/blog/fern-and-oak-ridgeline-lodge-wedding",
  "canonical_url": "https://yourstudio.com/blog/fern-and-oak-ridgeline-lodge-wedding",
  "description": "Fern and Oak said yes to each other on a windy ridge above the valley…",
  "keywords": ["Bend wedding photographer"],
  "indexable": true,
  "gallery_id": "…",
  "cover": {
    "id": "3f0c…", "alt": "Fern & Oak: a windy ridge wedding in Bend, Oregon by Fern & Field, photo 1",
    "width": 2000, "height": 1333, "focal": { "x": 50, "y": 38 },
    "url": "https://yourstudio.com/blog-media/8be7…/3f0c…/fern-oak-1-2000.jpg",
    "urls": { "sm": "…-400.webp", "md": "…-1000.webp", "lg": "…-2000.webp", "jpg": "…-2000.jpg" }
  },
  "photo_count": 48,
  "published_at": "2026-10-04T16:00:00.000Z",
  "created_at": "2026-10-01T16:00:00.000Z",
  "updated_at": "2026-10-05T16:00:00.000Z",
  "wordpress_url": null
}

Export: Share → Export downloads a post, or every post, as a zip of web pages, Markdown and the photos, and a WordPress file (wordpress.xml) any WordPress site imports with Tools → Import → WordPress. Your posts are yours: nothing is locked in.

Guide

Lightroom Classic (beta)

Publish a collection and it becomes a Terracotta gallery. Re-edit a photo and publish again to replace it. When clients pick favorites, bring them back to Lightroom as a collection in one click.

First: which Lightroom do you have?

Adobe makes two apps with nearly the same name, and only Lightroom Classic runs plugins. Check the app's name in your Applications folder, or open the File menu:

  • Adobe Lightroom Classic: the File menu has Plug-in Manager…, and the app has Library and Develop modules. This guide is for you.
  • Adobe Lightroom (the cloud version): the File menu starts with Cloud / Local and Add Photos, and there's no Plug-in Manager. Adobe doesn't allow plugins in this app.

On the cloud version? A direct connection is coming soon (see below). Until then, Lightroom Classic comes with most Adobe Photography plans at no extra cost: open the Creative Cloud app → Apps → Lightroom Classic → Install. It sits alongside the one you have. Or skip the plugin: in Lightroom, choose File → Export… (full-size JPEGs) and drag the exported photos into your gallery in the dashboard. To find clients' favorites, search their filenames with File → Search My Photos.

Install

  1. Unzip the download and keep the terracotta.lrplugin folder somewhere it can stay (Documents → Lightroom Plugins works).
  2. In Lightroom Classic, in the menu bar at the top of the screen (not the search box): File → Plug-in Manager… (⌥⇧⌘, on a Mac). Click Add at the bottom left, choose the folder, then Done.
  3. In your dashboard: Developers → New API key → Lightroom Classic. Copy the key.
  4. In Lightroom's Library, find Publish Services on the left and click Set Up… next to Terracotta. Paste the key, click Test key, then Save.

Publish a gallery

  1. Right-click the Terracotta service → Create Published Collection. Its name becomes the gallery's name.
  2. Drag photos in and click Publish. They upload as full-size sRGB JPEGs into a new draft gallery.
  3. Design and share it from your dashboard as usual. To open it, right-click the collection → Open gallery in Terracotta.
  4. Edited a photo? It moves to “Modified Photos to Re-Publish”; publish again to replace it. Removed one? Publish to take it out of the gallery.

Bring back client favorites

Library → Plug-in Extras → Get client favorites from Terracotta…, pick the gallery, and you get a collection named “Terracotta favorites: gallery”. Photos are matched by filename, so it works for galleries uploaded from Lightroom or the dashboard, as long as the files weren't renamed.

The plugin is in beta: tell us how it goes.

Guide

Lightroom (the cloud app): coming soon

A direct connection to Lightroom (the cloud app) is in testing with Adobe. Until it opens, the quickest route is:

  1. In Lightroom, select the photos and choose File → Export… (full-size JPEGs).
  2. Drag the exported photos into a gallery in your dashboard.
  3. For favorites, copy the file names from the gallery's Favorites tab and search for them in Lightroom.

Guide

Send client favorites somewhere else

Album designers, spreadsheets and retouching lists all start from the same feed: every favorite, with the filename, the client and their note.

curl "https://terracottagalleries.com/api/v1/favorites?since=2026-10-01T00:00:00Z" -H "Authorization: Bearer tc_live_…"

Keep the newest favorited_at you've seen and pass it as since next time to get only new ones.

Guide

Zapier and Make

Send published galleries to your CRM, add client favorites to a spreadsheet, or get a text when photos finish uploading, without writing code.

First, a key

In Dashboard → Developers → API keys choose Automations (Zapier / Make). Tick Client favorites too if your automation needs clients' names and emails.

Zapier

  1. Make a Zap and search for Terracotta as the trigger app.
  2. Pick a trigger: Gallery Published, New Favorites or Photos Ready. Sign in by pasting your key.
  3. Test the trigger: Zapier shows your latest real event (or an example if there isn't one yet). Add your action and turn the Zap on. Zapier adds its own endpoint (you'll see it under Webhooks in your dashboard) and removes it when you turn the Zap off.
  4. The action Create Gallery makes a draft gallery, for example from a booking form.

Terracotta not in Zapier's list yet? Use Webhooks by Zapier → Catch Hook: copy its URL into a new endpoint in Dashboard → Developers → Webhooks and pick your events.

Make

  1. Add the Terracotta app to a scenario and choose Watch events. Create a connection with your key.
  2. Pick the events. Make subscribes for you and unsubscribes when the webhook is deleted.
  3. Create a gallery and Make an API call are there as actions.

Without the app: add a Webhooks → Custom webhook module, copy its address into a new endpoint in your dashboard, then send a test event so Make learns the data's shape.

What's next

Missing something?

Want an integration or an API we don't have yet? Tell us.