Rechercher dans la documentation

Saisissez au moins deux caractères.

↑ ↓ naviguer↵ ouvriresc fermer
Référence MCP

update_email_template

Modifier un modèle d'email

Référence générée depuis le contrat versionné · Version Markdown

Rôle#

Enregistre une nouvelle version d'un modèle (nom, objet, pré-en-tête, blocs du catalogue) avec les mêmes contrôles que create_email_template. expectedVersion (l'updatedAt relu par get_template) refuse d'écraser une version enregistrée entre-temps. Un modèle archivé ne se modifie pas.

Accès#

Scope principal : marketing:write. Le scope ne remplace pas les gardes de visibilité, d'organisation, de module ni les scopes complémentaires des gestes composés.

Catalogue complet · Approbations

Paramètres#

Le schéma ci-dessous est produit par la fonction qui enregistre les outils, y compris idempotency_key lorsqu'elle s'applique. Consultez les objets imbriqués dans le schéma complet.

ChampTypeObligatoireDescription
idstringOui
expectedVersionunionNon
namestringNon
subjectstringNon
preheaderstringNon
blocksarrayNon
idempotency_keystringNonClé d'idempotence (recommandée) : rejouer la MÊME mutation avec la même clé renvoie la réponse originale sans ré-exécuter - TTL 24 h
Schéma JSON complet des paramètres
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "expectedVersion": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        {
          "type": "string",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        }
      ]
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "subject": {
      "type": "string",
      "maxLength": 300
    },
    "preheader": {
      "type": "string",
      "maxLength": 300
    },
    "blocks": {
      "maxItems": 60,
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "header"
              },
              "logo": {
                "default": "org",
                "type": "string",
                "enum": [
                  "org",
                  "unit"
                ]
              },
              "condition": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "enum": [
                      "contact",
                      "company",
                      "affiliation",
                      "quote",
                      "order",
                      "contract",
                      "invoice",
                      "sales_activity",
                      "marketing_consent",
                      "marketing_delivery",
                      "event_invitation",
                      "marketing_touch",
                      "tag"
                    ]
                  },
                  "field": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "op": {
                    "type": "string",
                    "enum": [
                      "is",
                      "is_not",
                      "contains",
                      "gt",
                      "lt",
                      "between",
                      "in",
                      "empty",
                      "not_empty",
                      "within_days",
                      "older_than_days"
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    ]
                  },
                  "not": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "object",
                  "field",
                  "op"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "title"
              },
              "text": {
                "type": "string",
                "maxLength": 200
              },
              "size": {
                "default": "large",
                "type": "string",
                "enum": [
                  "large",
                  "medium"
                ]
              },
              "condition": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "enum": [
                      "contact",
                      "company",
                      "affiliation",
                      "quote",
                      "order",
                      "contract",
                      "invoice",
                      "sales_activity",
                      "marketing_consent",
                      "marketing_delivery",
                      "event_invitation",
                      "marketing_touch",
                      "tag"
                    ]
                  },
                  "field": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "op": {
                    "type": "string",
                    "enum": [
                      "is",
                      "is_not",
                      "contains",
                      "gt",
                      "lt",
                      "between",
                      "in",
                      "empty",
                      "not_empty",
                      "within_days",
                      "older_than_days"
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    ]
                  },
                  "not": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "object",
                  "field",
                  "op"
                ]
              }
            },
            "required": [
              "type",
              "text"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "paragraph"
              },
              "text": {
                "type": "string",
                "maxLength": 4000
              },
              "condition": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "enum": [
                      "contact",
                      "company",
                      "affiliation",
                      "quote",
                      "order",
                      "contract",
                      "invoice",
                      "sales_activity",
                      "marketing_consent",
                      "marketing_delivery",
                      "event_invitation",
                      "marketing_touch",
                      "tag"
                    ]
                  },
                  "field": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "op": {
                    "type": "string",
                    "enum": [
                      "is",
                      "is_not",
                      "contains",
                      "gt",
                      "lt",
                      "between",
                      "in",
                      "empty",
                      "not_empty",
                      "within_days",
                      "older_than_days"
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    ]
                  },
                  "not": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "object",
                  "field",
                  "op"
                ]
              }
            },
            "required": [
              "type",
              "text"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "button"
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "url": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              "condition": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "enum": [
                      "contact",
                      "company",
                      "affiliation",
                      "quote",
                      "order",
                      "contract",
                      "invoice",
                      "sales_activity",
                      "marketing_consent",
                      "marketing_delivery",
                      "event_invitation",
                      "marketing_touch",
                      "tag"
                    ]
                  },
                  "field": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "op": {
                    "type": "string",
                    "enum": [
                      "is",
                      "is_not",
                      "contains",
                      "gt",
                      "lt",
                      "between",
                      "in",
                      "empty",
                      "not_empty",
                      "within_days",
                      "older_than_days"
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    ]
                  },
                  "not": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "object",
                  "field",
                  "op"
                ]
              }
            },
            "required": [
              "type",
              "label",
              "url"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "image"
              },
              "fileId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "alt": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "width": {
                "default": 600,
                "type": "integer",
                "minimum": 100,
                "maximum": 600
              },
              "align": {
                "type": "string",
                "enum": [
                  "left",
                  "center",
                  "right"
                ]
              },
              "condition": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "enum": [
                      "contact",
                      "company",
                      "affiliation",
                      "quote",
                      "order",
                      "contract",
                      "invoice",
                      "sales_activity",
                      "marketing_consent",
                      "marketing_delivery",
                      "event_invitation",
                      "marketing_touch",
                      "tag"
                    ]
                  },
                  "field": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "op": {
                    "type": "string",
                    "enum": [
                      "is",
                      "is_not",
                      "contains",
                      "gt",
                      "lt",
                      "between",
                      "in",
                      "empty",
                      "not_empty",
                      "within_days",
                      "older_than_days"
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    ]
                  },
                  "not": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "object",
                  "field",
                  "op"
                ]
              }
            },
            "required": [
              "type",
              "fileId",
              "alt"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "columns"
              },
              "left": {
                "type": "string",
                "maxLength": 4000
              },
              "right": {
                "type": "string",
                "maxLength": 4000
              },
              "condition": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "enum": [
                      "contact",
                      "company",
                      "affiliation",
                      "quote",
                      "order",
                      "contract",
                      "invoice",
                      "sales_activity",
                      "marketing_consent",
                      "marketing_delivery",
                      "event_invitation",
                      "marketing_touch",
                      "tag"
                    ]
                  },
                  "field": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "op": {
                    "type": "string",
                    "enum": [
                      "is",
                      "is_not",
                      "contains",
                      "gt",
                      "lt",
                      "between",
                      "in",
                      "empty",
                      "not_empty",
                      "within_days",
                      "older_than_days"
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    ]
                  },
                  "not": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "object",
                  "field",
                  "op"
                ]
              }
            },
            "required": [
              "type",
              "left",
              "right"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "divider"
              },
              "condition": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "enum": [
                      "contact",
                      "company",
                      "affiliation",
                      "quote",
                      "order",
                      "contract",
                      "invoice",
                      "sales_activity",
                      "marketing_consent",
                      "marketing_delivery",
                      "event_invitation",
                      "marketing_touch",
                      "tag"
                    ]
                  },
                  "field": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "op": {
                    "type": "string",
                    "enum": [
                      "is",
                      "is_not",
                      "contains",
                      "gt",
                      "lt",
                      "between",
                      "in",
                      "empty",
                      "not_empty",
                      "within_days",
                      "older_than_days"
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    ]
                  },
                  "not": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "object",
                  "field",
                  "op"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "product"
              },
              "productId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "condition": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "enum": [
                      "contact",
                      "company",
                      "affiliation",
                      "quote",
                      "order",
                      "contract",
                      "invoice",
                      "sales_activity",
                      "marketing_consent",
                      "marketing_delivery",
                      "event_invitation",
                      "marketing_touch",
                      "tag"
                    ]
                  },
                  "field": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "op": {
                    "type": "string",
                    "enum": [
                      "is",
                      "is_not",
                      "contains",
                      "gt",
                      "lt",
                      "between",
                      "in",
                      "empty",
                      "not_empty",
                      "within_days",
                      "older_than_days"
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    ]
                  },
                  "not": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "object",
                  "field",
                  "op"
                ]
              }
            },
            "required": [
              "type",
              "productId"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "signature"
              },
              "condition": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string",
                    "enum": [
                      "contact",
                      "company",
                      "affiliation",
                      "quote",
                      "order",
                      "contract",
                      "invoice",
                      "sales_activity",
                      "marketing_consent",
                      "marketing_delivery",
                      "event_invitation",
                      "marketing_touch",
                      "tag"
                    ]
                  },
                  "field": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "op": {
                    "type": "string",
                    "enum": [
                      "is",
                      "is_not",
                      "contains",
                      "gt",
                      "lt",
                      "between",
                      "in",
                      "empty",
                      "not_empty",
                      "within_days",
                      "older_than_days"
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    ]
                  },
                  "not": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "object",
                  "field",
                  "op"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "footer"
              }
            },
            "required": [
              "type"
            ]
          }
        ]
      }
    },
    "idempotency_key": {
      "description": "Clé d'idempotence (recommandée) : rejouer la MÊME mutation avec la même clé renvoie la réponse originale sans ré-exécuter - TTL 24 h",
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false
}