Skip to main content
PATCH
/
v1
/
signatures
/
{signature_id}
/
variants
/
{kind}
Create or update a variant (upsert)
curl --request PATCH \
  --url https://api.scribe-mail.com/v1/signatures/{signature_id}/variants/{kind} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "variant": {
    "draft_content": {
      "id": "<string>",
      "visible": true,
      "type": "stack",
      "blockStyle": {
        "marginBottom": 123,
        "marginRight": 123,
        "marginLeft": 123,
        "marginTop": 123,
        "paddingLeft": 123,
        "paddingRight": 123,
        "paddingTop": 123,
        "paddingBottom": 123,
        "backgroundColor": "<string>",
        "gap": 123,
        "width": 123
      },
      "children": [
        {
          "id": "<string>",
          "visible": true,
          "type": "text",
          "blockStyle": {
            "marginBottom": 123,
            "marginRight": 123,
            "marginLeft": 123,
            "marginTop": 123,
            "paddingLeft": 123,
            "paddingRight": 123,
            "paddingTop": 123,
            "paddingBottom": 123,
            "backgroundColor": "<string>",
            "gap": 123,
            "width": 123
          },
          "tokens": [
            {
              "id": "<string>",
              "type": "textToken",
              "value": "<string>",
              "smartFieldUuid": "<string>",
              "textStyle": {
                "fontSize": 123,
                "color": "<string>",
                "lineHeight": 5
              },
              "href": {
                "text": "<string>",
                "smartFieldUuid": "<string>"
              }
            }
          ],
          "displayName": "<string>"
        }
      ],
      "displayName": "<string>"
    },
    "activated": true,
    "hidden": true,
    "show_marketing_campaigns": true
  }
}
'
import requests

url = "https://api.scribe-mail.com/v1/signatures/{signature_id}/variants/{kind}"

payload = { "variant": {
"draft_content": {
"id": "<string>",
"visible": True,
"type": "stack",
"blockStyle": {
"marginBottom": 123,
"marginRight": 123,
"marginLeft": 123,
"marginTop": 123,
"paddingLeft": 123,
"paddingRight": 123,
"paddingTop": 123,
"paddingBottom": 123,
"backgroundColor": "<string>",
"gap": 123,
"width": 123
},
"children": [
{
"id": "<string>",
"visible": True,
"type": "text",
"blockStyle": {
"marginBottom": 123,
"marginRight": 123,
"marginLeft": 123,
"marginTop": 123,
"paddingLeft": 123,
"paddingRight": 123,
"paddingTop": 123,
"paddingBottom": 123,
"backgroundColor": "<string>",
"gap": 123,
"width": 123
},
"tokens": [
{
"id": "<string>",
"type": "textToken",
"value": "<string>",
"smartFieldUuid": "<string>",
"textStyle": {
"fontSize": 123,
"color": "<string>",
"lineHeight": 5
},
"href": {
"text": "<string>",
"smartFieldUuid": "<string>"
}
}
],
"displayName": "<string>"
}
],
"displayName": "<string>"
},
"activated": True,
"hidden": True,
"show_marketing_campaigns": True
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
variant: {
draft_content: {
id: '<string>',
visible: true,
type: 'stack',
blockStyle: {
marginBottom: 123,
marginRight: 123,
marginLeft: 123,
marginTop: 123,
paddingLeft: 123,
paddingRight: 123,
paddingTop: 123,
paddingBottom: 123,
backgroundColor: '<string>',
gap: 123,
width: 123
},
children: [
{
id: '<string>',
visible: true,
type: 'text',
blockStyle: {
marginBottom: 123,
marginRight: 123,
marginLeft: 123,
marginTop: 123,
paddingLeft: 123,
paddingRight: 123,
paddingTop: 123,
paddingBottom: 123,
backgroundColor: '<string>',
gap: 123,
width: 123
},
tokens: [
{
id: '<string>',
type: 'textToken',
value: '<string>',
smartFieldUuid: '<string>',
textStyle: {fontSize: 123, color: '<string>', lineHeight: 5},
href: {text: '<string>', smartFieldUuid: '<string>'}
}
],
displayName: '<string>'
}
],
displayName: '<string>'
},
activated: true,
hidden: true,
show_marketing_campaigns: true
}
})
};

fetch('https://api.scribe-mail.com/v1/signatures/{signature_id}/variants/{kind}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scribe-mail.com/v1/signatures/{signature_id}/variants/{kind}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'variant' => [
'draft_content' => [
'id' => '<string>',
'visible' => true,
'type' => 'stack',
'blockStyle' => [
'marginBottom' => 123,
'marginRight' => 123,
'marginLeft' => 123,
'marginTop' => 123,
'paddingLeft' => 123,
'paddingRight' => 123,
'paddingTop' => 123,
'paddingBottom' => 123,
'backgroundColor' => '<string>',
'gap' => 123,
'width' => 123
],
'children' => [
[
'id' => '<string>',
'visible' => true,
'type' => 'text',
'blockStyle' => [
'marginBottom' => 123,
'marginRight' => 123,
'marginLeft' => 123,
'marginTop' => 123,
'paddingLeft' => 123,
'paddingRight' => 123,
'paddingTop' => 123,
'paddingBottom' => 123,
'backgroundColor' => '<string>',
'gap' => 123,
'width' => 123
],
'tokens' => [
[
'id' => '<string>',
'type' => 'textToken',
'value' => '<string>',
'smartFieldUuid' => '<string>',
'textStyle' => [
'fontSize' => 123,
'color' => '<string>',
'lineHeight' => 5
],
'href' => [
'text' => '<string>',
'smartFieldUuid' => '<string>'
]
]
],
'displayName' => '<string>'
]
],
'displayName' => '<string>'
],
'activated' => true,
'hidden' => true,
'show_marketing_campaigns' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.scribe-mail.com/v1/signatures/{signature_id}/variants/{kind}"

payload := strings.NewReader("{\n \"variant\": {\n \"draft_content\": {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"stack\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"children\": [\n {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"text\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"tokens\": [\n {\n \"id\": \"<string>\",\n \"type\": \"textToken\",\n \"value\": \"<string>\",\n \"smartFieldUuid\": \"<string>\",\n \"textStyle\": {\n \"fontSize\": 123,\n \"color\": \"<string>\",\n \"lineHeight\": 5\n },\n \"href\": {\n \"text\": \"<string>\",\n \"smartFieldUuid\": \"<string>\"\n }\n }\n ],\n \"displayName\": \"<string>\"\n }\n ],\n \"displayName\": \"<string>\"\n },\n \"activated\": true,\n \"hidden\": true,\n \"show_marketing_campaigns\": true\n }\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.scribe-mail.com/v1/signatures/{signature_id}/variants/{kind}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variant\": {\n \"draft_content\": {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"stack\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"children\": [\n {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"text\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"tokens\": [\n {\n \"id\": \"<string>\",\n \"type\": \"textToken\",\n \"value\": \"<string>\",\n \"smartFieldUuid\": \"<string>\",\n \"textStyle\": {\n \"fontSize\": 123,\n \"color\": \"<string>\",\n \"lineHeight\": 5\n },\n \"href\": {\n \"text\": \"<string>\",\n \"smartFieldUuid\": \"<string>\"\n }\n }\n ],\n \"displayName\": \"<string>\"\n }\n ],\n \"displayName\": \"<string>\"\n },\n \"activated\": true,\n \"hidden\": true,\n \"show_marketing_campaigns\": true\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.scribe-mail.com/v1/signatures/{signature_id}/variants/{kind}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"variant\": {\n \"draft_content\": {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"stack\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"children\": [\n {\n \"id\": \"<string>\",\n \"visible\": true,\n \"type\": \"text\",\n \"blockStyle\": {\n \"marginBottom\": 123,\n \"marginRight\": 123,\n \"marginLeft\": 123,\n \"marginTop\": 123,\n \"paddingLeft\": 123,\n \"paddingRight\": 123,\n \"paddingTop\": 123,\n \"paddingBottom\": 123,\n \"backgroundColor\": \"<string>\",\n \"gap\": 123,\n \"width\": 123\n },\n \"tokens\": [\n {\n \"id\": \"<string>\",\n \"type\": \"textToken\",\n \"value\": \"<string>\",\n \"smartFieldUuid\": \"<string>\",\n \"textStyle\": {\n \"fontSize\": 123,\n \"color\": \"<string>\",\n \"lineHeight\": 5\n },\n \"href\": {\n \"text\": \"<string>\",\n \"smartFieldUuid\": \"<string>\"\n }\n }\n ],\n \"displayName\": \"<string>\"\n }\n ],\n \"displayName\": \"<string>\"\n },\n \"activated\": true,\n \"hidden\": true,\n \"show_marketing_campaigns\": true\n }\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "exists": true,
    "id": "<string>",
    "activated": true,
    "hidden": true,
    "show_marketing_campaigns": true,
    "content": {},
    "draft_content": {},
    "last_published_at": "2023-11-07T05:31:56Z",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}
{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>"
},
"remediation": {
"dashboard_url": "<string>",
"message": "<string>"
}
}
{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>"
},
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"allowed": [
"<unknown>"
],
"missing": [
"<string>"
]
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

signature_id
string
required
kind
enum<string>
required
Available options:
reply,
internal

Body

application/json
variant
object
required

Response

Upserted

data
object
required