TenanciTenanci

Help centerAPI referenceTailorKit

TailorKit

Per-domain branding and visual tweaks: draft, publishing and versions.

Get draft, published version and history

GET/domains/{id}/tailorkitdomains:read

Returns the current draft, the live document, the latest versions (up to 50) and the scheduled publish (scheduled, null if none). Rules saved in the old format (v1) come already converted to the v2 document.

Parameters

  • idpath · stringrequired

    Domain id (dom_…)

Request

cURL
curl "https://api.tenanci.com/v2/domains/dom_4h7n1q/tailorkit" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"

Response 200

{
  "draft": {
    "version": 3,
    "document": {
      "version": 2,
      "theme": {
        "colors": {
          "primary": "#b45309",
          "secondary": "#1f2937",
          "accent": null,
          "background": "#ffffff",
          "text": "#111827"
        },
        "fonts": {
          "heading": "Playfair Display",
          "body": "Inter"
        },
        "radius": 8,
        "logo": {
          "url": "https://assets.tenanci.com/org_5t1v/3n8q.png",
          "maxHeight": 48
        },
        "cssVars": {
          "--brand": "#b45309"
        },
        "logoTargets": []
      },
      "globalCss": "",
      "replacements": [
        {
          "find": "Agenda Fácil",
          "replace": "Barbearia do Zé",
          "caseSensitive": false
        }
      ],
      "pages": {
        "/": {
          "css": "",
          "rules": [
            {
              "id": "r_titulo",
              "target": {
                "tag": "h1",
                "id": null,
                "testId": null,
                "aria": null,
                "text": "Agende seu horário",
                "css": "main > h1:nth-of-type(1)",
                "attrs": {},
                "nth": 0
              },
              "action": {
                "type": "setText",
                "value": "Agende seu corte na Barbearia do Zé"
              },
              "devices": [],
              "enabled": true,
              "note": null
            }
          ]
        }
      }
    },
    "updatedAt": "2026-10-15T18:20:00.000Z"
  },
  "published": {
    "version": 2,
    "document": {
      "version": 2,
      "theme": {
        "colors": {
          "primary": "#b45309",
          "secondary": "#1f2937",
          "accent": null,
          "background": "#ffffff",
          "text": "#111827"
        },
        "fonts": {
          "heading": "Playfair Display",
          "body": "Inter"
        },
        "radius": 8,
        "logo": {
          "url": "https://assets.tenanci.com/org_5t1v/3n8q.png",
          "maxHeight": 48
        },
        "cssVars": {
          "--brand": "#b45309"
        },
        "logoTargets": []
      },
      "globalCss": "",
      "replacements": [],
      "pages": {
        "/": {
          "css": "",
          "rules": [
            {
              "id": "r_titulo",
              "target": {
                "tag": "h1",
                "id": null,
                "testId": null,
                "aria": null,
                "text": "Agende seu horário",
                "css": "main > h1:nth-of-type(1)",
                "attrs": {},
                "nth": 0
              },
              "action": {
                "type": "setText",
                "value": "Agende seu corte na Barbearia do Zé"
              },
              "devices": [],
              "enabled": true,
              "note": null
            }
          ]
        }
      }
    },
    "publishedAt": "2026-10-14T16:00:00.000Z"
  },
  "history": [
    {
      "version": 2,
      "status": "published",
      "publishedAt": "2026-10-14T16:00:00.000Z",
      "createdBy": "usr_01J9Z8Q3K4M5N6P7Q8R9S0T1V2"
    },
    {
      "version": 1,
      "status": "archived",
      "publishedAt": "2026-10-14T12:30:00.000Z",
      "createdBy": "usr_01J9Z8Q3K4M5N6P7Q8R9S0T1V2"
    }
  ],
  "scheduled": {
    "at": "2026-10-20T12:00:00.000Z",
    "version": 3,
    "by": "usr_01J9Z8Q3K4M5N6P7Q8R9S0T1V2"
  }
}

Save the draft

PUT/domains/{id}/tailorkit/draftdomains:writeGrowth+

Replaces the draft document (creates the draft if there is none). Nothing goes live until you publish. 1 MB limit (400 rules_too_large); an invalid document returns 400 invalid_rules with the problems in details. Older integrations may send { rules: … } in the v1 format, which is converted.

Parameters

  • idpath · stringrequired

    Domain id (dom_…)

Body

  • documentobjectrequired

    TailorKit 2.0 document: theme, global CSS, text replacements, per-page rules, A/B tests and translation.

    • version2required
    • breakpointsobject
      • tabletintegerrequired≥ 320, ≤ 2560
      • mobileintegerrequired≥ 240, ≤ 1600
    • themeobjectrequired
      • colorsobjectrequired
        • primarystring | nullrequired
        • secondarystring | nullrequired
        • accentstring | nullrequired
        • backgroundstring | nullrequired
        • textstring | nullrequired
      • fontsobjectrequired
        • headingstring | nullrequired
        • bodystring | nullrequired
      • radiusnumber | nullrequired
      • logoobject | nullrequired
        • urlstringrequiredmax 2048
        • maxHeightintegerrequired≤ 400
      • cssVarsRecord<string, string>required
      • logoTargetsobject[]required≤ 10 itens
        • tagstringrequiredmax 40
        • idstring | nullrequired
        • testIdstring | nullrequired
        • ariastring | nullrequired
        • textstring | nullrequired
        • cssstringrequiredmax 2000
        • attrsRecord<string, string>required
        • nthinteger | nullrequired
        • classesstring[]≤ 6 itens
    • globalCssstringrequiredmax 50000
    • replacementsobject[]required≤ 200 itens
      • findstringrequiredmin 1, max 500
      • replacestringrequiredmax 500
      • caseSensitivebooleanrequired
    • pagesRecord<string, object>required
    • experimentsobject[]≤ 10 itens
      • idstringrequired
      • namestringrequiredmin 1, max 80
      • status"draft" | "running" | "paused" | "ended"required
      • goalstring | nullrequired
      • controlWeightintegerrequired≥ 0, ≤ 100
      • variantsobject[]required≤ 3 itens
        • key"b" | "c" | "d"required
        • namestringrequiredmin 1, max 60
        • weightintegerrequired≥ 0, ≤ 100
        • pagesRecord<string, object>required
        • brandobject
      • winner"a" | "b" | "c" | "d" | nullrequired
      • startedAtstring | nullrequired
    • translationobject | null
      • langstringrequired
      • stringsRecord<string, string>required

Request

cURL
curl -X PUT "https://api.tenanci.com/v2/domains/dom_4h7n1q/tailorkit/draft" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"document":{"version":2,"theme":{"colors":{"primary":"#b45309","secondary":"#1f2937","accent":null,"background":"#ffffff","text":"#111827"},"fonts":{"heading":"Playfair Display","body":"Inter"},"radius":8,"logo":{"url":"https://assets.tenanci.com/org_5t1v/3n8q.png","maxHeight":48},"cssVars":{"--brand":"#b45309"},"logoTargets":[]},"globalCss":"","replacements":[{"find":"Agenda Fácil","replace":"Barbearia do Zé","caseSensitive":false}],"pages":{"/":{"css":"","rules":[{"id":"r_titulo","target":{"tag":"h1","id":null,"testId":null,"aria":null,"text":"Agende seu horário","css":"main > h1:nth-of-type(1)","attrs":{},"nth":0},"action":{"type":"setText","value":"Agende seu corte na Barbearia do Zé"},"devices":[],"enabled":true,"note":null}]}}}}'

Response 200

{
  "version": 3
}

Schedule the draft's publish

POST/domains/{id}/tailorkit/scheduledomains:writeGrowth+

Publishes the draft at the given time (from 1 minute up to 365 days ahead; otherwise 400 invalid_schedule). Scheduling again replaces the previous schedule. No draft: 400 no_draft.

Parameters

  • idpath · stringrequired

    Domain id (dom_…)

Body

  • atstringrequired

    Publish date and time (ISO 8601, with offset).

Request

cURL
curl -X POST "https://api.tenanci.com/v2/domains/dom_4h7n1q/tailorkit/schedule" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"at":"2026-10-20T09:00:00-03:00"}'

Response 200

{
  "version": 3,
  "at": "2026-10-20T12:00:00.000Z"
}

Cancel the scheduled publish

DELETE/domains/{id}/tailorkit/scheduledomains:write

canceled: false when there was no pending schedule. The draft stays saved.

Parameters

  • idpath · stringrequired

    Domain id (dom_…)

Request

cURL
curl -X DELETE "https://api.tenanci.com/v2/domains/dom_4h7n1q/tailorkit/schedule" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"

Response 200

{
  "canceled": true
}

Publish the draft now

POST/domains/{id}/tailorkit/publishdomains:writeGrowth+

The draft becomes the live version and the previous one goes to history. No draft: 400 no_draft. A pending schedule isn't canceled (if there's no draft at that time, it does nothing).

Parameters

  • idpath · stringrequired

    Domain id (dom_…)

Request

cURL
curl -X POST "https://api.tenanci.com/v2/domains/dom_4h7n1q/tailorkit/publish" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"

Response 200

{
  "version": 3
}

Roll back to a previous version

POST/domains/{id}/tailorkit/rollback/{version}domains:writeGrowth+

Copies the chosen version into a new version and publishes it. The current draft is discarded.

Parameters

  • idpath · stringrequired

    Domain id (dom_…)

  • versionpath · stringrequired

    Version number (see history)

Request

cURL
curl -X POST "https://api.tenanci.com/v2/domains/dom_4h7n1q/tailorkit/rollback/<version>" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"

Response 200

{
  "version": 4
}