{
  "openapi": "3.1.0",
  "info": {
    "title": "BodhX Send Message API",
    "version": "1.0.0",
    "description": "Send WhatsApp templates, and replies inside the 24-hour customer-service window, from the WhatsApp Business number connected to your BodhX AI agent. Every message appears in that agent's Inbox. Your code decides when to send; BodhX applies WhatsApp's rules (approved templates, the 24-hour window, STOP opt-outs) on every send."
  },
  "servers": [
    {
      "url": "https://api.bodhx.ai/api/v1",
      "description": "Production"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "x-rate-limits": [
    {
      "scope": "per key",
      "limit": 60,
      "window": "1 minute",
      "applies_to": "POST sends",
      "code": "rate_limited"
    },
    {
      "scope": "per key",
      "limit": 300,
      "window": "1 minute",
      "applies_to": "GET reads",
      "code": "rate_limited"
    },
    {
      "scope": "per account",
      "limit": 2000,
      "window": "1 UTC day",
      "applies_to": "messages sent",
      "code": "daily_limit"
    }
  ],
  "x-error-codes": {
    "unauthorized": [
      401,
      "No key, or a key that is not valid. Send Authorization: Bearer bx_live_..."
    ],
    "key_revoked": [
      401,
      "This key was revoked. Create a new one in BodhX."
    ],
    "insufficient_scope": [
      403,
      "The key lacks the permission this endpoint needs."
    ],
    "api_disabled": [
      503,
      "The Send Message API is switched off for now. Nothing was sent."
    ],
    "rate_limited": [
      429,
      "Too many requests a minute for this key. Retry shortly."
    ],
    "daily_limit": [
      429,
      "This account has sent its messages for today (UTC)."
    ],
    "invalid_request": [
      400,
      "A field is missing or has the wrong form. The message says which."
    ],
    "not_supported": [
      400,
      "type must be \"template\" or \"text\"."
    ],
    "account_inactive": [
      403,
      "The BodhX account is suspended or deleted."
    ],
    "agent_not_found": [
      403,
      "The agent this key belongs to no longer exists."
    ],
    "agent_paused": [
      403,
      "The agent is paused. Resume it in BodhX."
    ],
    "agent_has_no_whatsapp": [
      400,
      "The agent has no connected WhatsApp Business (Cloud API) number."
    ],
    "number_not_on_agent": [
      400,
      "from_phone_number_id is not one of this agent's numbers."
    ],
    "template_not_found": [
      400,
      "No template with this name and language on this number."
    ],
    "template_not_approved": [
      400,
      "The template is not approved by WhatsApp."
    ],
    "template_not_supported": [
      400,
      "Authentication (one-time code) templates cannot be sent through this API yet."
    ],
    "template_params_mismatch": [
      400,
      "The values do not fit the template. The message says what it needs."
    ],
    "invalid_number": [
      400,
      "\"to\" is not a phone number with a country code."
    ],
    "outside_service_window": [
      422,
      "Text only: the customer has not written, in the last 24 hours, to any WhatsApp number this API can send from. Send a template."
    ],
    "window_closed": [
      422,
      "Text only: the customer has not written to the sending number in the last 24 hours, but did write to another of this agent's numbers that this API can send from. The message names it and its from_phone_number_id; send from it, or send a template."
    ],
    "opted_out": [
      422,
      "The customer asked not to be messaged (STOP)."
    ],
    "not_on_whatsapp": [
      422,
      "WhatsApp reported this number is not on WhatsApp."
    ],
    "phone_conflict": [
      409,
      "The number matches a different customer's chat in this account."
    ],
    "idempotency_key_reused": [
      422,
      "This Idempotency-Key was used for a different message."
    ],
    "idempotency_conflict": [
      409,
      "Another request with this Idempotency-Key is being handled. Retry shortly."
    ],
    "request_in_progress": [
      409,
      "A repeat of an Idempotency-Key whose first request is still being sent. Nothing was sent again; retry after a few seconds to get the first request's answer."
    ],
    "send_blocked": [
      403,
      "BodhX's WhatsApp rules did not allow this message to this customer. Nothing was sent."
    ],
    "channel_unavailable": [
      503,
      "The agent's WhatsApp number cannot send right now. Reconnect it in BodhX."
    ],
    "send_failed": [
      502,
      "WhatsApp did not accept the message. It was not sent."
    ],
    "partially_sent": [
      502,
      "A long text was split and only part of it reached the customer. Do not send the whole message again."
    ],
    "internal_error": [
      500,
      "Our fault. Nothing was sent."
    ],
    "message_not_found": [
      404,
      "No message with this id for this agent."
    ]
  },
  "paths": {
    "/messages/template": {
      "post": {
        "operationId": "sendTemplate",
        "summary": "Send a template",
        "description": "Sends an APPROVED template of this agent's number. Allowed any time, also outside the 24-hour window. One attempt: a send is never repeated by BodhX.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateMessage"
              },
              "example": {
                "to": "+919812345678",
                "template": {
                  "name": "order_update",
                  "language": "en",
                  "body_values": [
                    "Asha",
                    "A-1001"
                  ],
                  "button_values": {
                    "0": "A-1001"
                  }
                },
                "callback_data": "order-1001"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent to WhatsApp. A repeat of the same Idempotency-Key whose first request was sent answers 200 again with the first id and idempotent_replay: true, and sends nothing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                },
                "example": {
                  "id": "6f1c2a8e-4b1d-4f3a-9c51-2f7d0e9a1b33",
                  "status": "sent"
                }
              }
            }
          },
          "202": {
            "description": "The result is uncertain (a timeout after the request left). It is never sent again; check GET /messages/{id}. A repeat of the same Idempotency-Key answers this same 202.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                },
                "example": {
                  "id": "6f1c2a8e-4b1d-4f3a-9c51-2f7d0e9a1b33",
                  "status": "unconfirmed"
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be sent as written. Codes: invalid_request, not_supported, invalid_number, agent_has_no_whatsapp, number_not_on_agent, template_not_found, template_not_approved, template_not_supported, template_params_mismatch.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed. Codes: insufficient_scope, account_inactive, agent_not_found, agent_paused, send_blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A conflict with another request or chat. Codes: idempotency_conflict, request_in_progress, phone_conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "This customer cannot receive it. Codes: outside_service_window, window_closed, opted_out, not_on_whatsapp, idempotency_key_reused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "description": "Our fault. Nothing was sent. Codes: internal_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "The message reached WhatsApp and was refused, in full (send_failed) or after part of a split text arrived (partially_sent). Never retried: a repeat of the same Idempotency-Key answers this same 502. Codes: send_failed, partially_sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Not available right now. Nothing was sent: retry later with the SAME Idempotency-Key, and it is a fresh attempt. Codes: api_disabled, channel_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messages/text": {
      "post": {
        "operationId": "sendText",
        "summary": "Send a text reply",
        "description": "Sends free text, only while the customer-service window is open: the customer wrote to this number in the last 24 hours. Otherwise 422 outside_service_window and nothing is sent.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TextMessage"
              },
              "example": {
                "to": "+919812345678",
                "text": "Your order A-1001 is packed and leaves today."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent to WhatsApp. A repeat of the same Idempotency-Key whose first request was sent answers 200 again with the first id and idempotent_replay: true, and sends nothing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                },
                "example": {
                  "id": "6f1c2a8e-4b1d-4f3a-9c51-2f7d0e9a1b33",
                  "status": "sent"
                }
              }
            }
          },
          "202": {
            "description": "The result is uncertain (a timeout after the request left). It is never sent again; check GET /messages/{id}. A repeat of the same Idempotency-Key answers this same 202.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                },
                "example": {
                  "id": "6f1c2a8e-4b1d-4f3a-9c51-2f7d0e9a1b33",
                  "status": "unconfirmed"
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be sent as written. Codes: invalid_request, not_supported, invalid_number, agent_has_no_whatsapp, number_not_on_agent, template_not_found, template_not_approved, template_not_supported, template_params_mismatch.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed. Codes: insufficient_scope, account_inactive, agent_not_found, agent_paused, send_blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A conflict with another request or chat. Codes: idempotency_conflict, request_in_progress, phone_conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "This customer cannot receive it. Codes: outside_service_window, window_closed, opted_out, not_on_whatsapp, idempotency_key_reused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "description": "Our fault. Nothing was sent. Codes: internal_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "The message reached WhatsApp and was refused, in full (send_failed) or after part of a split text arrived (partially_sent). Never retried: a repeat of the same Idempotency-Key answers this same 502. Codes: send_failed, partially_sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Not available right now. Nothing was sent: retry later with the SAME Idempotency-Key, and it is a fresh attempt. Codes: api_disabled, channel_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messages": {
      "post": {
        "operationId": "sendMessage",
        "summary": "Send (type in the body)",
        "description": "The same send as the two endpoints above, with \"type\": \"template\" (the default) or \"text\" in the body.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/TemplateMessage"
                  },
                  {
                    "$ref": "#/components/schemas/TextMessage"
                  }
                ]
              },
              "example": {
                "type": "template",
                "to": "+919812345678",
                "template": {
                  "name": "order_update",
                  "language": "en",
                  "body_values": [
                    "Asha",
                    "A-1001"
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent to WhatsApp. A repeat of the same Idempotency-Key whose first request was sent answers 200 again with the first id and idempotent_replay: true, and sends nothing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                },
                "example": {
                  "id": "6f1c2a8e-4b1d-4f3a-9c51-2f7d0e9a1b33",
                  "status": "sent"
                }
              }
            }
          },
          "202": {
            "description": "The result is uncertain (a timeout after the request left). It is never sent again; check GET /messages/{id}. A repeat of the same Idempotency-Key answers this same 202.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                },
                "example": {
                  "id": "6f1c2a8e-4b1d-4f3a-9c51-2f7d0e9a1b33",
                  "status": "unconfirmed"
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be sent as written. Codes: invalid_request, not_supported, invalid_number, agent_has_no_whatsapp, number_not_on_agent, template_not_found, template_not_approved, template_not_supported, template_params_mismatch.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Not allowed. Codes: insufficient_scope, account_inactive, agent_not_found, agent_paused, send_blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A conflict with another request or chat. Codes: idempotency_conflict, request_in_progress, phone_conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "This customer cannot receive it. Codes: outside_service_window, window_closed, opted_out, not_on_whatsapp, idempotency_key_reused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "description": "Our fault. Nothing was sent. Codes: internal_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "The message reached WhatsApp and was refused, in full (send_failed) or after part of a split text arrived (partially_sent). Never retried: a repeat of the same Idempotency-Key answers this same 502. Codes: send_failed, partially_sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Not available right now. Nothing was sent: retry later with the SAME Idempotency-Key, and it is a fresh attempt. Codes: api_disabled, channel_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messages/{id}": {
      "get": {
        "operationId": "getMessage",
        "summary": "Get a message's status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The id a send returned."
          }
        ],
        "responses": {
          "200": {
            "description": "The message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                },
                "example": {
                  "id": "6f1c2a8e-4b1d-4f3a-9c51-2f7d0e9a1b33",
                  "status": "delivered",
                  "reason": null,
                  "error_code": null,
                  "to": "919812345678",
                  "type": "template",
                  "template": "order_update",
                  "callback_data": "order-1001",
                  "created_at": "2026-11-09T10:15:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Not found. Codes: message_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/templates": {
      "get": {
        "operationId": "listTemplates",
        "summary": "List approved templates",
        "description": "The approved templates of this agent's connected number(s), with how many values each needs.",
        "responses": {
          "200": {
            "description": "Templates you can send.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Template"
                      }
                    }
                  }
                },
                "example": {
                  "templates": [
                    {
                      "name": "order_update",
                      "language": "en",
                      "category": "UTILITY",
                      "phone_number_id": "109876543210",
                      "body_placeholders": 2,
                      "header_type": null,
                      "header_placeholders": 0,
                      "buttons": [
                        {
                          "index": 0,
                          "type": "URL",
                          "text": "Track",
                          "needs_value": true
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No number. Codes: agent_has_no_whatsapp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "bx_live_...",
        "description": "A key of ONE agent, made by the account owner in BodhX: Automation > CRM & Software > Receive from your software. Shown once; revoke it there."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 255
        },
        "description": "Recommended. Within 24 hours, a repeat of the same key sends nothing and answers EXACTLY what the first request answered: the same HTTP status, code and id (200 sent, 202 unconfirmed, the same 502 when WhatsApp refused it). While the first request is still being sent, a repeat answers 409 request_in_progress: retry after a few seconds. When the first request sent NOTHING (500 internal_error, 503 channel_unavailable, 403 send_blocked, 422 window closed on the wire), a later repeat is a fresh attempt. The same key with a different message is 422 idempotency_key_reused."
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing, unknown or revoked key. Codes: unauthorized, key_revoked.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Slow down. Codes: rate_limited, daily_limit.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "statusCode",
          "code",
          "message"
        ],
        "properties": {
          "statusCode": {
            "type": "integer"
          },
          "code": {
            "type": "string",
            "description": "Stable. Branch on this, not on message."
          },
          "message": {
            "type": "string",
            "description": "A plain sentence for a person."
          },
          "id": {
            "type": "string",
            "description": "Present when a message row was made (a send that failed)."
          }
        },
        "example": {
          "statusCode": 422,
          "code": "outside_service_window",
          "message": "This customer has not messaged this number in the last 24 hours, so WhatsApp only allows a template. Send an approved template instead."
        }
      },
      "SendResult": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "unconfirmed",
              "queued",
              "delivered",
              "read",
              "failed"
            ]
          },
          "idempotent_replay": {
            "type": "boolean",
            "description": "true when this answer is the first message of the same Idempotency-Key."
          }
        }
      },
      "TemplateMessage": {
        "type": "object",
        "required": [
          "to",
          "template"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "template"
            ]
          },
          "to": {
            "type": "string",
            "maxLength": 40,
            "description": "The customer's WhatsApp number with its country code: +919812345678 or 919812345678.",
            "example": "+919812345678"
          },
          "from_phone_number_id": {
            "type": "string",
            "description": "Optional. One of THIS agent's connected numbers (phone_number_id from GET /templates). Default: the agent's first connected number. Another agent's number is refused (number_not_on_agent)."
          },
          "callback_data": {
            "type": "string",
            "maxLength": 512,
            "description": "Optional. Your own reference (an order id); returned by GET /messages/{id}."
          },
          "template": {
            "type": "object",
            "required": [
              "name",
              "language"
            ],
            "properties": {
              "name": {
                "type": "string",
                "example": "order_update"
              },
              "language": {
                "type": "string",
                "example": "en",
                "description": "The template's language code as approved (en, en_US, hi)."
              },
              "body_values": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 1024
                },
                "description": "One value per {{n}} in the body, in order."
              },
              "header": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "The header's {{1}}, when it has one."
                  },
                  "media_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https:// link to the image, video or document of a media header."
                  }
                }
              },
              "button_values": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Keyed by button index: the {{1}} of a link button, or a quick-reply payload."
              }
            }
          }
        }
      },
      "TextMessage": {
        "type": "object",
        "required": [
          "to",
          "text"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text"
            ]
          },
          "to": {
            "type": "string",
            "maxLength": 40,
            "description": "The customer's WhatsApp number with its country code: +919812345678 or 919812345678.",
            "example": "+919812345678"
          },
          "from_phone_number_id": {
            "type": "string",
            "description": "Optional. One of THIS agent's connected numbers. Default: the agent's number the customer last wrote to. A number the customer has not written to in the last 24 hours is refused with 422 window_closed. Another agent's number is refused (number_not_on_agent)."
          },
          "callback_data": {
            "type": "string",
            "maxLength": 512,
            "description": "Optional. Your own reference (an order id); returned by GET /messages/{id}."
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          }
        }
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "sent",
              "delivered",
              "read",
              "failed",
              "unconfirmed"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it failed or is unconfirmed."
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "WhatsApp's own error code, when it gave one."
          },
          "to": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "template",
              "text"
            ]
          },
          "template": {
            "type": [
              "string",
              "null"
            ]
          },
          "callback_data": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Template": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "phone_number_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "body_placeholders": {
            "type": "integer"
          },
          "header_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "TEXT",
              "IMAGE",
              "VIDEO",
              "DOCUMENT",
              "LOCATION",
              null
            ]
          },
          "header_placeholders": {
            "type": "integer"
          },
          "buttons": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "type": {
                  "type": "string"
                },
                "text": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "needs_value": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    }
  }
}
