# Compare two templates

Compare two templates.

Endpoint: POST /v1/projects/{projectId}/whatsapp/templates/{templateName}/languages/{languageCode}/compare
Version: 1.2.91
Security: BasicAuth, BearerAuth, OAuth2Production

## Path parameters:

  - `projectId` (string, required)
    The unique ID of the project. You can find this on the Sinch Dashboard.

  - `templateName` (string, required)
    The unique name of the template.

  - `languageCode` (string, required)
    The language code of the specific template.
    Enum: "AF", "AR", "AZ", "BG", "BN", "CA", "CS", "DA", "DE", "EL", "EN", "EN_GB", "EN_US", "ES", "ES_AR", "ES_ES", "ES_MX", "ES_UY", "ET", "FA", "FI", "FIL", "FR", "GA", "GU", "HA", "HE", "HI", "HR", "HU", "ID", "IT", "JA", "KA", "KK", "KN", "KO", "KY_KG", "LO", "LT", "LV", "MK", "ML", "MR", "MS", "NB", "NL", "PA", "PL", "PT_BR", "PT_PT", "RO", "RU", "RW_RW", "SK", "SL", "SQ", "SR", "SV", "SW", "TA", "TE", "TH", "TR", "UK", "UR", "UZ", "VI", "ZH_CN", "ZH_HK", "ZH_TW", "ZU", "UNRECOGNIZED"

## Request fields (application/json):

  - `templates` (array, required)
    List of templates

  - `templates.templateName` (string, required)
    Template name

  - `templates.templateLanguage` (string, required)
    Template language
    Enum: same as `languageCode` (73 values)

  - `timeframe` (string)
    Timeframes are limited to 7, 30, 60 and 90 day lookbacks from the time of the request
    Enum: "30", "60", "7", "90"

  - `endTimestamp` (number)
    End of timeframe (default: now)

## Response 200 fields (application/json):

  - `templates` (array, required)
    List of templates

  - `templates.name` (string, required)
    Template name

  - `templates.language` (string, required)
    Template language
    Enum: same as `languageCode` (73 values)

  - `templates.blockOrder` (number, required)
    Order of block rate

  - `templates.messageSends` (number, required)
    Message send number

  - `templates.topBlockReason` (string, required)
    Block reason
    Enum: "NO_LONGER_NEEDED", "NO_REASON", "NO_REASON_GIVEN", "NO_SIGN_UP", "OFFENSIVE_MESSAGES", "OTHER", "OTP_DID_NOT_REQUEST", "SPAM", "UNKNOWN_BLOCK_REASON", "UNRECOGNIZED"

## Response 400 fields (application/json):

  - `body` (InvalidInputErrorTitle (object) or ProjectNotInitializedErrorTitle (object) or TemplateInvalidLanguageCodeErrorTitle (object) or InvalidPayloadErrorTitle (object)) — one of:
    - InvalidInputErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "invalid_input"
      - `message` (string)
        Human readable message.
        Example: "Invalid input."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Correct the validation errors and submit again."
      - `additionalInformation` (object)
        Additional information for error.
        Example: {"validationErrors":["templates must be an array","templates must contain no more than 1 elements","templates must contain at least 1 elements"]}
    - ProjectNotInitializedErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "project_not_initialized"
      - `message` (string)
        Human readable message.
        Example: "Project not initialized for WhatsApp."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that the project ID is correct and that it has been onboarded for WhatsApp."
    - TemplateInvalidLanguageCodeErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "template_invalid_language_code"
      - `message` (string)
        Human readable message.
        Example: "Invalid language code."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that the language code used is supported by the Provisioning API and WhatsApp."
      - `additionalInformation` (object)
        Additional information for error.
        Example: {"supportedCodes":"AF, AR, AZ, BG, BN, CA, CS, DA, DE, EL, EN, EN_GB, EN_US, ES, ES_AR, ES_ES, ES_MX, ES_UY, ET, FA, FI, FIL, FR, GA, GU, HA, HE, HI, HR, HU, ID, IT, JA, KA, KK, KN, KO, KY_KG, LO, LT, LV, MK, ML, MR, MS, NB, NL, PA, PL, PT_BR, PT_PT, RO, RU, RW_RW, SK, SL, SQ, SR, SV, SW, TA, TE, TH, TR, UK, UR, UZ, VI, ZH_CN, ZH_HK, ZH_TW, ZU"}
    - InvalidPayloadErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "invalid_payload"
      - `message` (string)
        Human readable message.
        Example: "Invalid payload."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Correct payload and submit again."

## Response 401 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "unauthorized_error"

  - `message` (string)
    Human readable message.
    Example: "Unauthorized error."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Verify that projectId is correct."

## Response 404 fields (application/json):

  - `body` (TemplateNotFoundErrorTitle (object) or TemplatesCompareNotFoundErrorTitle (object)) — one of:
    - TemplateNotFoundErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "template_not_found"
      - `message` (string)
        Human readable message.
        Example: "Template not found."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that the parameters are correct."
    - TemplatesCompareNotFoundErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "templates_compare_not_found"
      - `message` (string)
        Human readable message.
        Example: "Templates to compare not found."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that the parameters are correct. No templates found for templateName: templateName and templateLanguage: EN"

## Response 409 fields (application/json):

  - `body` (TemplatesNotEligibleForComparisonErrorTitle (object) or TemplatesCompareNotUniqueErrorTitle (object)) — one of:
    - TemplatesNotEligibleForComparisonErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "templates_not_eligible_for_comparison"
      - `message` (string)
        Human readable message.
        Example: "Templates not eligible for comparison."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Templates must have been sent at least 1,000 times in the specified timeframe."
    - TemplatesCompareNotUniqueErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "templates_compare_not_unique"
      - `message` (string)
        Human readable message.
        Example: "Templates to compare not unique."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Template can't be compared with itself. Provide unique templates for comparison."

## Response 500 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "internal_error"

  - `message` (string)
    Human readable message.
    Example: "Internal server error."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Please wait and try again, if the error persist please contact support."


