API reference

Templates

Read approved WhatsApp message templates.

Every request needs x-tenant-id and an API key or OAuth token. Channel IDs are copied from Settings → Developer in the app. See Authentication.

List templates

get/api/public/v1/templates

Returns a paginated, filterable, sortable list of WhatsApp templates for the authenticated tenant. DRAFT templates are never returned.

Query parameters

  • pageinteger

    Default 1

  • limitinteger

    Default 25

  • sortstring

    namestatuscategorylanguagelastSyncedAtupdatedAtcreatedAt

    Default "updatedAt"

  • orderstring

    ascdesc

    Default "desc"

  • categorystring

    MARKETINGUTILITYAUTHENTICATION

  • languagestring

    Language code, e.g. "en" or "en_US".

  • statusstring

    Approval status (DRAFT is never exposed).

    APPROVEDPENDINGREJECTEDPAUSEDDISABLEDIN_APPEALDELETED

  • searchstring

    Case-insensitive template name search.

  • channelIdstring

    Channel id from Settings → Developer → Channels, to narrow by channel.

  • createdAfterstring (date-time)
  • createdBeforestring (date-time)
  • updatedAfterstring (date-time)
  • updatedBeforestring (date-time)
  • fieldsstring
Response 200Paginated list of templates
  • successboolean
  • dataobject[]
    16 child fields
    • idstring
    • namestring
    • categorystring | null

      One ofMARKETINGUTILITYAUTHENTICATIONnull

    • languagestring | null
    • statusstring | null

      One ofAPPROVEDPENDINGREJECTEDPAUSEDDISABLEDIN_APPEALDELETEDnull

    • templateTypestring | null
    • parameterFormatstring | null
    • headerTypestring | null
    • hasButtonsboolean
    • componentsobject | null
      5 child fields
      • headerobject | null
        4 child fields
        • formatstring | null
        • textstring | null
        • filenamestring | null
        • mimeTypestring | null
      • bodyobject | null
        1 child field
        • textstring | null
      • footerobject | null
        1 child field
        • textstring | null
      • buttonsobject[] | null
        4 child fields
        • typestring | null
        • textstring | null
        • urlstring | null
        • phoneNumberstring | null
      • carouselobject | null
    • examplesobject | array | null
    • variablesobject | null
    • qualityScoreobject | null
      2 child fields
      • scorestring | number | null
      • datestring (date-time) | null
    • rejectionReasonstring | null
    • createdAtstring (date-time) | null
    • updatedAtstring (date-time) | null
  • paginationobject
    8 child fields
    • pageinteger
    • limitinteger
    • totalinteger
    • totalPagesinteger
    • hasNextPageboolean
    • hasPrevPageboolean
    • nextCursorstring | null
    • prevCursorstring | null
  • metaobject
    1 child field
    • apiVersionstring
  • requestIdstring | null
  • timestampstring (date-time)

Errors

  • 400Malformed request or missing tenant context
  • 401Missing or invalid API key
  • 403Forbidden - developer platform disabled, key expired/disabled, or tenant mismatch
  • 422Validation failed (invalid filters, sort, status, language, or date range)
  • 429Too many requests - rate limit exceeded
  • 500Unexpected server error
Error envelope and fixes →
curl -X GET "https://api.inaiy.com/api/public/v1/templates" \
  -H "x-tenant-id: demo" \
  -H "x-api-key: wp_live_xxxxxxxxxxxxxxxxxxxx"
Response 200
{
  "success": true,
  "data": [
    {
      "id": "6650a1b2c3d4e5f6a7b8c9d0",
      "name": "order_update",
      "category": "UTILITY",
      "language": "en_US",
      "status": "APPROVED",
      "templateType": "STANDARD",
      "parameterFormat": "POSITIONAL",
      "headerType": "TEXT",
      "hasButtons": true,
      "components": {
        "header": {
          "format": "TEXT",
          "text": "Order {{1}} update",
          "filename": null,
          "mimeType": null
        },
        "body": {
          "text": "Hi {{1}}, your order is {{2}}."
        },
        "footer": {
          "text": "Reply STOP to unsubscribe"
        },
        "buttons": [
          {
            "type": "URL",
            "text": "Track order",
            "url": "https://example.com/track/{{1}}",
            "phoneNumber": null
          }
        ],
        "carousel": null
      },
      "examples": null,
      "variables": {
        "parameterFormat": "POSITIONAL",
        "body": [
          "1",
          "2"
        ],
        "header": {
          "type": "text",
          "keys": [
            "1"
          ]
        },
        "buttons": [
          {
            "index": 0,
            "type": "URL",
            "keys": [
              "1"
            ]
          }
        ]
      },
      "qualityScore": {
        "score": "GREEN",
        "date": "2026-07-10T09:30:00.000Z"
      },
      "rejectionReason": null,
      "createdAt": "2026-07-01T09:30:00.000Z",
      "updatedAt": "2026-07-10T09:31:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 25,
    "total": 42,
    "totalPages": 2,
    "hasNextPage": true,
    "hasPrevPage": false,
    "nextCursor": null,
    "prevCursor": null
  },
  "meta": {
    "apiVersion": "v1",
    "sort": {
      "field": "createdAt",
      "order": "desc"
    }
  },
  "requestId": "a1f4c2e0-9b6d-4a1e-8c3f-2d7e5b9a0c11",
  "timestamp": "2026-07-12T09:30:00.000Z"
}

Get template(s) by id or name

get/api/public/v1/templates/{idOrName}

When the path value is a 24-char ObjectId, returns the single matching template (a local DRAFT is treated as 404). Otherwise the value is treated as an exact template name and a LIST of all matching templates (all languages, or narrowed by ?language=) is returned.

Path parameters

  • idOrNamestringrequired

    Either a 24-char template ObjectId (returns a single template) or a template name (returns a list of all matching templates across languages).

Query parameters

  • languagestring

    Narrow by language when looking up by name (ignored for id lookups).

  • pageinteger

    Default 1

  • limitinteger

    Default 25

  • fieldsstring
Response 200A single template (id lookup) or a list of templates (name lookup)
  • successboolean
  • dataobject
    16 child fields
    • idstring
    • namestring
    • categorystring | null

      One ofMARKETINGUTILITYAUTHENTICATIONnull

    • languagestring | null
    • statusstring | null

      One ofAPPROVEDPENDINGREJECTEDPAUSEDDISABLEDIN_APPEALDELETEDnull

    • templateTypestring | null
    • parameterFormatstring | null
    • headerTypestring | null
    • hasButtonsboolean
    • componentsobject | null
      5 child fields
      • headerobject | null
        4 child fields
        • formatstring | null
        • textstring | null
        • filenamestring | null
        • mimeTypestring | null
      • bodyobject | null
        1 child field
        • textstring | null
      • footerobject | null
        1 child field
        • textstring | null
      • buttonsobject[] | null
        4 child fields
        • typestring | null
        • textstring | null
        • urlstring | null
        • phoneNumberstring | null
      • carouselobject | null
    • examplesobject | array | null
    • variablesobject | null
    • qualityScoreobject | null
      2 child fields
      • scorestring | number | null
      • datestring (date-time) | null
    • rejectionReasonstring | null
    • createdAtstring (date-time) | null
    • updatedAtstring (date-time) | null
  • metaobject
    1 child field
    • apiVersionstring
  • requestIdstring | null
  • timestampstring (date-time)

Errors

  • 400Malformed request or missing tenant context
  • 401Missing or invalid API key
  • 403Forbidden - developer platform disabled, key expired/disabled, or tenant mismatch
  • 404Template not found
  • 422Validation failed (invalid filters, sort, status, language, or date range)
  • 429Too many requests - rate limit exceeded
  • 500Unexpected server error
Error envelope and fixes →
curl -X GET "https://api.inaiy.com/api/public/v1/templates/6650a1b2c3d4e5f6a7b8c9d0" \
  -H "x-tenant-id: demo" \
  -H "x-api-key: wp_live_xxxxxxxxxxxxxxxxxxxx"
Response 200
{
  "success": true,
  "data": {
    "id": "6650a1b2c3d4e5f6a7b8c9d0",
    "name": "order_update",
    "category": "UTILITY",
    "language": "en_US",
    "status": "APPROVED",
    "templateType": "STANDARD",
    "parameterFormat": "POSITIONAL",
    "headerType": "TEXT",
    "hasButtons": true,
    "components": {
      "header": {
        "format": "TEXT",
        "text": "Order {{1}} update",
        "filename": null,
        "mimeType": null
      },
      "body": {
        "text": "Hi {{1}}, your order is {{2}}."
      },
      "footer": {
        "text": "Reply STOP to unsubscribe"
      },
      "buttons": [
        {
          "type": "URL",
          "text": "Track order",
          "url": "https://example.com/track/{{1}}",
          "phoneNumber": null
        }
      ],
      "carousel": null
    },
    "examples": null,
    "variables": {
      "parameterFormat": "POSITIONAL",
      "body": [
        "1",
        "2"
      ],
      "header": {
        "type": "text",
        "keys": [
          "1"
        ]
      },
      "buttons": [
        {
          "index": 0,
          "type": "URL",
          "keys": [
            "1"
          ]
        }
      ]
    },
    "qualityScore": {
      "score": "GREEN",
      "date": "2026-07-10T09:30:00.000Z"
    },
    "rejectionReason": null,
    "createdAt": "2026-07-01T09:30:00.000Z",
    "updatedAt": "2026-07-10T09:31:00.000Z"
  },
  "meta": {
    "apiVersion": "v1"
  },
  "requestId": "a1f4c2e0-9b6d-4a1e-8c3f-2d7e5b9a0c11",
  "timestamp": "2026-07-12T09:30:00.000Z"
}