GoliathDevelopersGet an API key
Reference/Compliance Sitesgenerated from the gateway manifest

previewComplianceSiteEdit

Preview a compliance-site edit.

POST/api/v1/callWRITEidempotent · 24 hruns as the key's owner
View as Markdown

Preview a compliance-site edit (org admins): only the facts that change (tagline, contactEmail, contactPhone, contactName, contactTitle, markets; null clears). Refused when it would move the business name, legal entity or opt-in wording; else what the site would show and the previewId to republish. Nothing is published.

curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "previewComplianceSiteEdit",
    "variables": {
      "edit": {}
    }
  }'
import { GoliathClient } from '@goliath-data/sdk'

const goliath = new GoliathClient({
  apiKey: process.env.GOLIATH_API_KEY!,
  baseUrl: 'https://server.goliathdata.com',
})

const result = await goliath.complianceSites.previewComplianceSiteEdit(
  {
    edit: {}
  },
  { idempotencyKey: crypto.randomUUID() },
)
const res = await fetch('https://server.goliathdata.com/api/v1/call', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    operationId: 'previewComplianceSiteEdit',
    variables: {
      edit: {}
    }
  }),
})
const { data, errors } = await res.json()

Variables

The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.

editComplianceSiteEditInput!required

An edit of a compliance site. Give only what changes; null clears a saved value. `businessName` is accepted only to be refused: the name is the brand registration's.

businessNameString
taglineString
contactEmailString
contactPhoneString
contactNameString
contactTitleString
markets[String!]

Response

What comes back under data: a list shows as one entry, and a value as its type.

response shape
{
  "data": {
    "complianceSiteMutation": {
      "previewEdit": {
        "ok": true,
        "refusals": [
          "…"
        ],
        "previewId": "…",
        "liveUrl": "…",
        "rolledBack": true,
        "ignored": [
          "…"
        ],
        "facts": {
          "businessName": "…",
          "legalEntityName": "…",
          "tagline": "…",
          "contactEmail": "…",
          "contactPhone": "…",
          "contactName": "…",
          "contactTitle": "…",
          "markets": [
            "…"
          ],
          "seed": "…"
        }
      }
    }
  }
}

Errors

Idempotency

Send an Idempotency-Key of 1 to 255 characters. A finished request retried with the same key replays its stored response, marked Idempotency-Replayed: true; one still in flight returns 409 idempotency_conflict. Keys expire after 24 hours. Write without fear →