Skip to content
campaiDeveloper
campai.com

Templates · Design

POST/{organizationId}/templates/copyDefaultTransactionalDesignReads only

Copy default email design

Copies an authorized published transactional design into independently owned temporary assets for a new message.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Permission checks in detail
Also checked, depending on the request and the records it touches
  • template.read
  • dispatchDocument.insert
  • mailing.insert
  • mailing.edit
  • contactRule.insert
  • contactRule.edit

Request

Path parameters

  • organizationIdidrequired

Body

Content-Type: application/json

  • transactionalTypestring

    default "content"

    content action
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/templates/copyDefaultTransactionalDesign' \
  --header 'X-API-Key: YOUR_API_KEY'

No request that worked has been recorded yet, so the body is not shown.

Response

200 Successful response

Content-Type: application/json

  • emailobject
    5 properties
    • versionnumber
    • channelstring
    • containerobject
      8 properties
      • typestring
      • idstring

        pattern ^[a-zA-Z0-9_-]+$

      • desktopobject
        1 property
        • paddingany[]

          exactly 4 items

      • mobileobject
        1 property
        • paddingany[]nullable

          exactly 4 items

      • widthinteger
      • fontFamilystring
        17 values
        System Arial, Helvetica, sans-serif Arial Black, Gadget, sans-serif Comic Sans MS, Textile, Cursive, sans-serif Courier New, Courier, Monospace, monospace Georgia, Times New Roman, Times, serif Helvetica, Arial, serif Impact, Charcoal, sans-serif Lucida Console, Monaco, Monospace, monospace Lucida Sans Unicode, Lucida Grande, sans-serif Palatino Linotype, Book Antiqua, Palatino, serif Tahoma, Geneva, sans-serif Times New Roman, Times, serif Trebuchet MS, Helvetica, sans-serif Verdana, Geneva, sans-serif MS Sans Serif, Geneva, sans-serif MS Serif, New York, serif
      • backgroundobject
        3 properties
        • backgroundColorobject
          2 properties
          • colorstring

            pattern ^#[0-9A-F]{6}$

          • hideboolean
        • backgroundGradientobject
          3 properties
          • hideboolean
          • stopsobject[]
            2 properties
            • colorstring

              pattern ^#[0-9A-F]{6,8}$

            • positionnumber

              at least 0

          • angleinteger
        • backgroundImageobject
          4 properties
          • hideboolean
          • imageobjectnullable
          • sizestring
            cover contain fill tile
          • positionstring
            top left top center top right middle left middle center middle right bottom left bottom center bottom right
      • itemsobject[]
        14 properties
        • idstring

          pattern ^[a-zA-Z0-9_-]+$

        • namestring

          at most 32 characters

        • hideOnMobileboolean
        • hideOnDesktopboolean
        • hiddenboolean
        • lockedboolean
        • conditionobjectnullable
          2 properties
          • operatorstring
            and or
          • conditions(object (recursive) | object)[]

            at least 1 items

            4 properties
            • leftobject | object of any
              Variant 1: 1 property
              • variablestring

                at least 1 characters

              Variant 2: 4 properties
              • sourceobject
                1 property
                • variablestring

                  at least 1 characters

              • lookupobjectnullable
                1 property
                • variablestring

                  at least 1 characters

              • arrayboolean
              • selectobject (recursive)
              Variant 3: 2 properties
              • funcstring
                33 values
                concat ifEmpty lowercase uppercase substring trim abs ceil floor min max mod sum sub mul div avg med parseNumber formatNumber dateOnly dateTime dateOnlyPart dateTimePart age dateOnlyDifference dateTimeDifference setDateOnly setDateTime addDateOnly addDateTime formatDateOnly formatDateTime
              • paramsobject (recursive)[]
              Variant 4: 1 property
              • literalnumber[] | number
              Variant 5: 3 properties
              • ifobject (recursive)
              • thenobject (recursive)
              • elseobject (recursive)
            • cmpFuncstring
              15 values
              eq isSet lt lte gt gte includes contains startsWith endsWith before beforeAt after afterAt isToday
            • rightobject | object of any
              Variant 1: 1 property
              • variablestring

                at least 1 characters

              Variant 2: 4 properties
              • sourceobject
                1 property
                • variablestring

                  at least 1 characters

              • lookupobjectnullable
                1 property
                • variablestring

                  at least 1 characters

              • arrayboolean
              • selectobject (recursive)
              Variant 3: 2 properties
              • funcstring
                33 values
                concat ifEmpty lowercase uppercase substring trim abs ceil floor min max mod sum sub mul div avg med parseNumber formatNumber dateOnly dateTime dateOnlyPart dateTimePart age dateOnlyDifference dateTimeDifference setDateOnly setDateTime addDateOnly addDateTime formatDateOnly formatDateTime
              • paramsobject (recursive)[]
              Variant 4: 1 property
              • literalnumber[] | number
              Variant 5: 3 properties
              • ifobject (recursive)
              • thenobject (recursive)
              • elseobject (recursive)
            • negateboolean
        • desktopobject
          3 properties
          • marginany[]

            exactly 4 items

          • paddingany[]

            exactly 4 items

          • radiusnumber | any[]
        • mobileobject
          3 properties
          • marginany[]nullable

            exactly 4 items

          • paddingany[]nullable

            exactly 4 items

          • radiusnumber | any[]nullable
        • typestring
        • repeatobjectnullable
          1 property
          • sourceobject
            1 property
            • variablestring

              at least 1 characters

        • backgroundobject
          3 properties
          • backgroundColorobject
            2 properties
            • colorstring

              pattern ^#[0-9A-F]{6}$

            • hideboolean
          • backgroundGradientobject
            3 properties
            • hideboolean
            • stopsobject[]
              2 properties
              • colorstring

                pattern ^#[0-9A-F]{6,8}$

              • positionnumber

                at least 0

            • angleinteger
          • backgroundImageobject
            4 properties
            • hideboolean
            • imageobjectnullable
            • sizestring
              cover contain fill tile
            • positionstring
              top left top center top right middle left middle center middle right bottom left bottom center bottom right
        • borderobject
          4 properties
          • colorstring

            pattern ^#[0-9A-F]{6}$

          • widthnumber | any[]
          • stylestring
            solid dotted dashed
          • hideboolean
        • itemsobject[]
    • languagesstring[]

      at least 1 items · each at least 2 characters

    • resourcesobject[]
      5 properties
      • resourcestring

        at least 1 characters

      • fileNamestring

        at most 128 characters

      • contentTypestring

        at most 75 characters

      • fileSizeBytesinteger

        at least 0

      • idstring

        exactly 6 characters

Response200
{
  "email": {
    "version": 1,
    "channel": "email",
    "container": {
      "type": "container",
      "id": "string",
      "desktop": {
        "padding": [
          null
        ]
      },
      "mobile": {
        "padding": [
          null
        ]
      },
      "width": 1,
      "fontFamily": "System",
      "background": {
        "backgroundColor": {
          "color": "string",
          "hide": true
        },
        "backgroundGradient": {
          "hide": true,
          "stops": [
            {
              "color": "string",
              "position": 0
            }
          ],
          "angle": 1
        },
        "backgroundImage": {
          "hide": true,
          "image": {
            "type": "resource",
            "resourceId": "string"
          },
          "size": "cover",
          "position": "top left"
        }
      },
      "items": [
        {
          "id": "string",
          "name": "string",
          "hideOnMobile": true,
          "hideOnDesktop": true,
          "hidden": true,
          "locked": true,
          "condition": {
            "operator": "and",
            "conditions": [
              null
            ]
          },
          "desktop": {
            "margin": [
              null
            ],
            "padding": [
              null
            ],
            "radius": 0
          },
          "mobile": {
            "margin": [
              null
            ],
            "padding": [
              null
            ],
            "radius": 0
          },
          "type": "block",
          "repeat": {
            "source": {
              "variable": "string"
            }
          },
          "background": {
            "backgroundColor": {
              "color": "string",
              "hide": true
            },
            "backgroundGradient": {
              "hide": true,
              "stops": [
                {
                  "color": "string",
                  "position": 0
                }
              ],
              "angle": 1
            },
            "backgroundImage": {
              "hide": true,
              "image": {
                "type": "resource",
                "resourceId": "string"
              },
              "size": "cover",
              "position": "top left"
            }
          },
          "border": {
            "color": "string",
            "width": 0,
            "style": "solid",
            "hide": true
          },
          "items": [
            {
              "id": "string",
              "name": "string",
              "hideOnMobile": true,
              "hideOnDesktop": true,
              "hidden": true,
              "locked": true,
              "condition": {
                "operator": "and",
                "conditions": [
                  null
                ]
              },
              "desktop": {
                "width": {
                  "type": "hug",
                  "width": {
                    "value": 0,
                    "unit": "#"
                  }
                }
              },
              "mobile": {
                "width": {
                  "type": "hug",
                  "width": {
                    "value": 0,
                    "unit": "#"
                  }
                }
              },
              "type": "table",
              "align": "left",
              "border": {
                "color": "string",
                "width": 0,
                "style": "solid",
                "hide": true
              },
              "collapseMobile": true,
              "items": [
                {
                  "id": "string",
                  "name": "string",
                  "hideOnMobile": true,
                  "hideOnDesktop": true,
                  "hidden": true,
                  "locked": true,
                  "condition": {
                    "operator": "and",
                    "conditions": null
                  },
                  "desktop": {
                    "placement": "top left",
                    "height": {
                      "value": 0,
                      "unit": "#"
                    }
                  },
                  "mobile": {
                    "placement": "top left",
                    "height": {
                      "value": null,
                      "unit": "#"
                    }
                  },
                  "type": "tableRow",
                  "repeat": {
                    "source": {
                      "variable": null
                    }
                  },
                  "backgroundColor": {
                    "color": "string",
                    "hide": true
                  },
                  "border": {
                    "color": "string",
                    "width": 0,
                    "style": "solid",
                    "hide": true
                  },
                  "items": [
                    {
                      "id": "string",
                      "name": "string",
                      "hideOnMobile": true,
                      "hideOnDesktop": true,
                      "hidden": true,
                      "locked": true,
                      "condition": null,
                      "desktop": {
                        "placement": "inherit",
                        "width": null,
                        "padding": null
                      },
                      "mobile": {
                        "placement": "inherit",
                        "width": null,
                        "padding": null
                      },
                      "type": "tableCell",
                      "background": {
                        "backgroundColor": null,
                        "backgroundGradient": null,
                        "backgroundImage": null
                      },
                      "items": [
                        null
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    "languages": [
      "string"
    ],
    "resources": [
      {
        "resource": "string",
        "id": "string"
      }
    ]
  }
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.