WhatsApp · WhatsApp

Update template

Updates a template. Fields you leave out keep their current values.

PATCHhttps://api.pozy.ai/v1/whatsapp/templates/{templateName}
updateWhatsAppTemplate

Guide: Message templates

Request

Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the accounts resource group disabled get 403 resource_group_disabled. Authentication

Path parameters

NameTypeNotes
templateNamerequiredstring

Request body

application/json, required

  • accountIdstringrequired
  • languagestring
  • componentsarray of object

    At least 1 item.

    One of:

    Whats App Header Component (4 fields)
    • typestringrequired

      One of header.

    • formatstringrequired

      One of text, image, video, gif, document, location.

    • textstring
    • exampleobject
      3 child fields
      • header_textarray of string
      • header_text_named_paramsarray of object
        2 child fields
        • param_namestringrequired

          Matches ^[a-z0-9_]+$.

        • examplestringrequired
      • header_handlearray of string (URL)

        At least 1 item. Up to 1 items.

    Whats App Body Component (4 fields)
    • typestringrequired

      One of body.

    • textstringrequired
    • add_security_recommendationboolean
    • exampleobject
      2 child fields
      • body_textarray of array of string
      • body_text_named_paramsarray of object
        2 child fields
        • param_namestringrequired

          Matches ^[a-z0-9_]+$.

        • examplestringrequired
    Whats App Footer Component (3 fields)
    • typestringrequired

      One of footer.

    • textstring
    • code_expiration_minutesinteger

      At least 1.

    Whats App Buttons Component (2 fields)
    • typestringrequired

      One of buttons.

    • buttonsarray of objectrequired

      At least 1 item.

      14 child fields
      • typestringrequired

        One of quick_reply, url, phone_number, otp, copy_code, flow, mpm, catalog.

      • textstring
      • urlstring (URL)
      • exampleany
      • phone_numberstring
      • otp_typestring

        One of copy_code, one_tap, zero_tap.

      • autofill_textstring
      • package_namestring
      • signature_hashstring
      • flow_idstring
      • flow_namestring
      • flow_jsonstring
      • flow_actionstring
      • navigate_screenstring
    Whats App Carousel Component (2 fields)
    • typestringrequired

      One of carousel.

    • cardsarray of objectrequired

      At least 2 items. Up to 10 items.

      1 child field
      • componentsarray of objectrequired

        At least 1 item.

        One of:

        Whats App Header Component (4 fields)
        • typestringrequired

          One of header.

        • formatstringrequired

          One of text, image, video, gif, document, location.

        • textstring
        • exampleobject
          3 child fields
          • header_textarray of string
          • header_text_named_paramsarray of object
            2 child fields
            • param_namestringrequired

              Matches ^[a-z0-9_]+$.

            • examplestringrequired
          • header_handlearray of string (URL)

            At least 1 item. Up to 1 items.

        Whats App Body Component (4 fields)
        • typestringrequired

          One of body.

        • textstringrequired
        • add_security_recommendationboolean
        • exampleobject
          2 child fields
          • body_textarray of array of string
          • body_text_named_paramsarray of object
            2 child fields
            • param_namestringrequired

              Matches ^[a-z0-9_]+$.

            • examplestringrequired
        Whats App Buttons Component (2 fields)
        • typestringrequired

          One of buttons.

        • buttonsarray of objectrequired

          At least 1 item.

          14 child fields
          • typestringrequired

            One of quick_reply, url, phone_number, otp, copy_code, flow, mpm, catalog.

          • textstring
          • urlstring (URL)
          • exampleany
          • phone_numberstring
          • otp_typestring

            One of copy_code, one_tap, zero_tap.

          • autofill_textstring
          • package_namestring
          • signature_hashstring
          • flow_idstring
          • flow_namestring
          • flow_jsonstring
          • flow_actionstring
          • navigate_screenstring
    Whats App Limited Time Offer Component (2 fields)
    • typestringrequired

      One of limited_time_offer.

    • limited_time_offerobjectrequired
      2 child fields
      • textstringrequired

        1 to 16 characters.

      • has_expirationboolean
  • message_send_ttl_secondsinteger

Example

curl -X PATCH "https://api.pozy.ai/v1/whatsapp/templates/Acme" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9"
}'

Response

200 on success

  • successboolean
  • templateobject
    • idstring
    • namestring
    • languagestring
    • statusstring
200 response
{
  "success": true,
  "template": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "name": "Acme",
    "language": "en",
    "status": "active"
  }
}

Errors

Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is read-only, scoped to other profiles, or has this resource group disabled.
404not_foundNothing with that id exists in your workspace.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in WhatsApp