{
  "openapi": "3.0.3",
  "info": {
    "title": "CRM API",
    "description": "Endpoint the operator implements so the Gamanza Engage Platform (PEP) can hand off an already rendered CRM message. PEP calls Send Message Relay Proxy when a channel is configured to use the operator for delivery. The body is not a Mailjet, SendGrid, or Routee payload. It contains no vendor credentials, IP pools, or vendor callback URLs.\n\nOne request is one channel and one or more players. The callback sits once on the request. Names are camelCase. playerDeliverId is the only player-delivery id. batchId identifies the request.\n\nReturn 202 before calling your own provider. PEP's adapter times out at 30 seconds. 202 means the handoff is queued. It does not mean the player already has the message. Do not call callback.url while producing the 202.\n\nThe rules for the two keys and the channel content are on Send Message Relay Proxy.\n\ncontractVersion is the integer 1. An unknown version is a non-202. Unknown optional fields on version 1 are ignored. Adding an optional field later stays on version 1. Removing a field, or changing the type of a field, is a new version.",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://operator.example",
      "description": "The operator host the adapter already calls for Assign Bonus and Assign Cash."
    }
  ],
  "tags": [
    {
      "name": "CrmMessageController"
    }
  ],
  "paths": {
    "/api/crm/v1/send-message": {
      "post": {
        "summary": "Send Message Relay Proxy",
        "description": "Today Gamanza Engage sends CRM messages through its own providers. The Send Message Relay Proxy hands an already rendered message to your platform, so you can deliver it with your own provider and the CRM can still track the result.\n\nReturn 202 Accepted before you call that provider, then process the send in the background.\n\nOn receipt:\n\n1. Validate the body.\n2. Store batchId, callback, and every item.\n3. Return 202 within a few seconds. Do not call your provider, look up a contact, or wait for delivery before that response.\n\nOnly 202 accepts the handoff. Any other response activates a retry, including 200, 4xx, 5xx, a timeout, and a transport error. PEP retries that handoff up to 10 times.\n\nEach request is one channel. The batch size is 100 players.\n\nTwo keys:\n\n| Key | Identifies | What you do |\n| --- | --- | --- |\n| batchId | This request | Persist it with the item playerDeliverId values before 202. A known batchId, in progress or finished, returns 202 and does not deliver again. If the content differs, keep the content you accepted first. |\n| playerDeliverId | One player | The delivery id of that player. Persist it. Do not deliver a second message for that id. Return 202 for that id when the batchId is one you already stored. The platform does not put that player on a new batchId while the first batch can still be accepted. If you already delivered that id, do not deliver it again. |\n\nA failed batch is retried with the same batchId, the same players, and the same playerDeliverId values. Content is rendered again and may change. Keep the first accepted content.\n\nContent. items[].content matches channel. One request is one channel.\n\n| Channel | Required | Optional |\n| --- | --- | --- |\n| email | subject, html, fromEmail | fromName, replyTo |\n| sms | text | — |\n| on_site | contentHtml, language | templateType, isHtmlContent |\n| web_push | title, body | url, icon, image, actions |\n| push_in_app | title, body, language | url, icon, image |\n| rich_inbox | title, message, contentHtml | language, templateType, displayType, buttonText, buttonUrl, imageUrl, terms, snackbarIcon, snackbarText, snackbarButtonText, snackbarContentHtml |\n\nEmail has no text. SMS has no from. On-site has no title and no body. Rich inbox has no body and no html.\n\n#### Include Contact Point\n\nInclude Contact Point is a CRM setting. It is off by default. If you need Gamanza Engage to send contact information, ask your CSM to turn it on, and make sure the player's contact information is registered in Gamanza Engage.\n\nWhen it is off, the request does not include an email, a phone number, or a push subscription. Gamanza Engage is not responsible for finding the recipient. You determine it from playerId, according to the channel.\n\nWhen it is on, the request adds only that channel's contact, taken from the player stored by Register Player or Update Player.\n\nOn-site and rich inbox never send contact. Those channels are always addressed by playerId.\n\nAfter your provider reports a result, POST one event per item to callback.url. That call is Register External Message Event - Analytics. Sending the events is optional. If you do not send them, the analytics are not shown in the CRM section. Send channel, eventType, occurredAt, playerDeliverId, and playerId at the root. playerDeliverId and playerId are the values from that send item. channel is the channel of this request.",
        "operationId": "CrmMessageController_SendMessage",
        "tags": [
          "CrmMessageController"
        ],
        "security": [
          {
            "OAuth2": []
          }
        ],
        "parameters": [
          {
            "name": "x-authorization",
            "description": "In order to provide a proper API integration, the Gamanza Engage Platform supports the following authentication methods that should be implemented by the operator's platform: API Key (API Key value) or Client Credentials (accessToken)",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/crm_messageSendMessageRequest"
              },
              "examples": {
                "email": {
                  "summary": "email",
                  "value": {
                    "contractVersion": 1,
                    "batchId": "b8b68eb1-bc04-43b8-b553-7efda707b6d8",
                    "channel": "email",
                    "callback": {
                      "method": "POST",
                      "url": "https://platform-api-{customer-instance-id}.gamanzaengage.com/rx-api/analytics/v1/external/messages/events"
                    },
                    "items": [
                      {
                        "playerDeliverId": "66f1a2b3c4d5e6f7a8b9c0d1",
                        "playerId": "player-1001",
                        "type": "marketing",
                        "content": {
                          "subject": "Your weekend bonus is ready",
                          "html": "<p>Hello, your bonus is ready.</p>",
                          "fromEmail": "crm@operator.example",
                          "fromName": "Operator CRM"
                        }
                      }
                    ]
                  }
                },
                "sms": {
                  "summary": "sms",
                  "value": {
                    "contractVersion": 1,
                    "batchId": "c4d5e6f7-a8b9-4c0d-9e1f-223344556677",
                    "channel": "sms",
                    "callback": {
                      "method": "POST",
                      "url": "https://platform-api-{customer-instance-id}.gamanzaengage.com/rx-api/analytics/v1/external/messages/events"
                    },
                    "items": [
                      {
                        "playerDeliverId": "66f1a2b3c4d5e6f7a8b9c0d2",
                        "playerId": "player-1002",
                        "type": "marketing",
                        "content": {
                          "text": "Your bonus is ready."
                        }
                      }
                    ]
                  }
                },
                "on_site": {
                  "summary": "on_site",
                  "value": {
                    "contractVersion": 1,
                    "batchId": "d5e6f7a8-b9c0-4d1e-8f2a-334455667788",
                    "channel": "on_site",
                    "callback": {
                      "method": "POST",
                      "url": "https://platform-api-{customer-instance-id}.gamanzaengage.com/rx-api/analytics/v1/external/messages/events"
                    },
                    "items": [
                      {
                        "playerDeliverId": "66f1a2b3c4d5e6f7a8b9c0d3",
                        "playerId": "player-1003",
                        "type": "marketing",
                        "content": {
                          "contentHtml": "<p>Hello, your bonus is ready.</p>",
                          "language": "en",
                          "templateType": "POPUP",
                          "isHtmlContent": true
                        }
                      }
                    ]
                  }
                },
                "web_push": {
                  "summary": "web_push",
                  "value": {
                    "contractVersion": 1,
                    "batchId": "e6f7a8b9-c0d1-4e2f-9a3b-445566778899",
                    "channel": "web_push",
                    "callback": {
                      "method": "POST",
                      "url": "https://platform-api-{customer-instance-id}.gamanzaengage.com/rx-api/analytics/v1/external/messages/events"
                    },
                    "items": [
                      {
                        "playerDeliverId": "66f1a2b3c4d5e6f7a8b9c0d4",
                        "playerId": "player-1004",
                        "type": "marketing",
                        "content": {
                          "title": "Bonus ready",
                          "body": "Your weekend bonus is ready.",
                          "url": "https://operator.example/bonus",
                          "actions": [
                            {
                              "title": "Claim",
                              "action": "claim"
                            }
                          ]
                        }
                      }
                    ]
                  }
                },
                "push_in_app": {
                  "summary": "push_in_app",
                  "value": {
                    "contractVersion": 1,
                    "batchId": "f7a8b9c0-d1e2-4f3a-8b4c-556677889900",
                    "channel": "push_in_app",
                    "callback": {
                      "method": "POST",
                      "url": "https://platform-api-{customer-instance-id}.gamanzaengage.com/rx-api/analytics/v1/external/messages/events"
                    },
                    "items": [
                      {
                        "playerDeliverId": "66f1a2b3c4d5e6f7a8b9c0d5",
                        "playerId": "player-1005",
                        "type": "transactional",
                        "content": {
                          "title": "Bonus ready",
                          "body": "Your weekend bonus is ready.",
                          "language": "en"
                        }
                      }
                    ]
                  }
                },
                "rich_inbox": {
                  "summary": "rich_inbox",
                  "value": {
                    "contractVersion": 1,
                    "batchId": "a8b9c0d1-e2f3-4a4b-9c5d-667788990011",
                    "channel": "rich_inbox",
                    "callback": {
                      "method": "POST",
                      "url": "https://platform-api-{customer-instance-id}.gamanzaengage.com/rx-api/analytics/v1/external/messages/events"
                    },
                    "items": [
                      {
                        "playerDeliverId": "66f1a2b3c4d5e6f7a8b9c0d6",
                        "playerId": "player-1006",
                        "type": "marketing",
                        "content": {
                          "title": "Bonus ready",
                          "message": "Your weekend bonus is ready.",
                          "contentHtml": "<p>Hello, your bonus is ready.</p>",
                          "language": "en",
                          "displayType": "SNACKBAR_ON_SCREEN"
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. The handoff is queued. The response body is ignored. This does not mean the player has the message."
          },
          "400": {
            "description": "The body is not version 1 of this contract. PEP treats this as a failure and retries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseHttpErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. The x-authorization header is missing or not accepted."
          },
          "500": {
            "description": "Internal server error. PEP treats this as a failure and retries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/crm_messageInternalErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "description": "The client needs to authenticate themselves for this request. The auth request returns a valid JWT access token",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://platform-api-{customer-instance-id}gamanzaengage.com/api",
            "scopes": {}
          }
        }
      }
    },
    "schemas": {
      "crm_messageSendMessageRequest": {
        "type": "object",
        "description": "One rendered batch. One channel. One callback for the whole batch. At least one player item.",
        "required": [
          "contractVersion",
          "batchId",
          "channel",
          "callback",
          "items"
        ],
        "properties": {
          "contractVersion": {
            "type": "integer",
            "format": "int32",
            "enum": [
              1
            ],
            "description": "Contract version. PEP always sends the integer 1. Read it before accepting the batch. A missing value, or any value other than 1, is a non-202. Keep accepting version 1 when PEP adds an optional field. Reject the request when a required field disappears or changes type, because that body is a new version. A retry that changes contractVersion is no longer version 1. Do not treat that retry as the same contract."
          },
          "batchId": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of this request. Required. Persist it with the playerDeliverId values of the items before you return 202. If this batchId is already known, in progress or finished, return 202 and do not deliver again. If a known batchId arrives with different content, keep the content accepted first. A missing batchId is a non-202. It identifies the request, not a player."
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms",
              "on_site",
              "web_push",
              "push_in_app",
              "rich_inbox"
            ],
            "description": "The channel for every item in this request. PEP sends one of email, sms, on_site, web_push, push_in_app, or rich_inbox. One request never mixes channels. Use it to choose the content object. Any other string is a non-202. If a retry changes channel for a batchId that was already accepted, return 202, do not deliver a second message, and do not switch the player to another channel."
          },
          "callback": {
            "$ref": "#/components/schemas/crm_messageCallback",
            "description": "Where to report provider results later. Present once on the request. It is not repeated on each item. It does not include eventType, occurredAt, playerDeliverId, or playerId. Those belong on the event you POST to callback.url. Store method and url with the batch. Do not call url while producing the 202. A missing callback is a non-202. If a retry changes url for a batch already accepted, keep the first stored url and do not deliver the player-facing message again."
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "description": "Players in this batch. PEP sends at least one item. The batch size is configured on the platform. Accept the batch. Idempotency is the request batchId and each item's playerDeliverId. A missing items array, or an empty array, is a non-202.",
            "items": {
              "$ref": "#/components/schemas/crm_messageItem"
            }
          }
        },
        "example": {
          "contractVersion": 1,
          "batchId": "b8b68eb1-bc04-43b8-b553-7efda707b6d8",
          "channel": "email",
          "callback": {
            "method": "POST",
            "url": "https://platform-api-{customer-instance-id}.gamanzaengage.com/rx-api/analytics/v1/external/messages/events"
          },
          "items": [
            {
              "playerDeliverId": "66f1a2b3c4d5e6f7a8b9c0d1",
              "playerId": "player-1001",
              "type": "marketing",
              "content": {
                "subject": "Your weekend bonus is ready",
                "html": "<p>Hello, your bonus is ready.</p>",
                "fromEmail": "crm@operator.example",
                "fromName": "Operator CRM"
              }
            }
          ]
        }
      },
      "crm_messageCallback": {
        "type": "object",
        "description": "Where to report provider results later. Present once on the request. It is not repeated on each item. It does not include eventType, occurredAt, playerDeliverId, or playerId. Those belong on the event you POST to callback.url. Store method and url with the batch. Do not call url while producing the 202. A missing callback is a non-202. If a retry changes url for a batch already accepted, keep the first stored url and do not deliver the player-facing message again.",
        "required": [
          "method",
          "url"
        ],
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "POST"
            ],
            "description": "HTTP method for the later event. PEP always sends POST. Any other value is a non-202. Send the event with POST."
          },
          "url": {
            "type": "string",
            "example": "https://platform-api-{customer-instance-id}.gamanzaengage.com/rx-api/analytics/v1/external/messages/events",
            "description": "Absolute URL that receives one event per item after your provider reports a result. PEP chooses it. On your platform it is https://platform-api-{customer-instance-id}.gamanzaengage.com/rx-api/analytics/v1/external/messages/events. The operator does not choose this URL. When PEP has no callback configured, PEP does not call Send Message at all, so you never see an empty URL. A missing or relative URL is a non-202. If a retry presents a different URL for a batch already accepted, keep the first URL and do not send the player-facing message again. A URL that is not live yet is not a reason to fail the send."
          }
        }
      },
      "crm_messageItem": {
        "type": "object",
        "description": "One player in the batch. Idempotency of the request is batchId. Idempotency of this player is playerDeliverId.",
        "required": [
          "playerDeliverId",
          "playerId",
          "type",
          "content"
        ],
        "properties": {
          "playerDeliverId": {
            "type": "string",
            "example": "66f1a2b3c4d5e6f7a8b9c0d1",
            "description": "The delivery id of this player. Example: 66f1a2b3c4d5e6f7a8b9c0d1. It is not the campaign delivery id and it is not batchId. Persist it. A second acceptance of the same id must not deliver a second player-facing message. A retry sends the same id. Content is rendered again and may change; keep the first accepted content. If it is missing, return a non-202. If a retry changes the id, treat it as a different delivery. Do not overwrite the first id. On the later event, send this same string as playerDeliverId."
          },
          "playerId": {
            "type": "string",
            "example": "player-1001",
            "description": "Your player id. Always present. When contact is absent, this id is how you find the address, phone, or device. On-site and rich inbox always use this id as the recipient, because those channels never send contact. If it is missing, return a non-202. If a retry changes playerId for a playerDeliverId already accepted, do not deliver again and do not move the message to the new player. On the later event, send this same id as playerId."
          },
          "type": {
            "type": "string",
            "enum": [
              "marketing",
              "transactional"
            ],
            "description": "Delivery class for this item: marketing or transactional. It is not the template type. Template type, when a channel has one, is inside content. Use it to choose your marketing or transactional path. Any other string is a non-202. If it is missing, return a non-202. If a retry changes type for an id already accepted, keep the first type and do not deliver again."
          },
          "content": {
            "description": "Rendered message for this item. PEP has already rendered it. Do not compile a template and do not look up a template id. There is no template id in this body. The object is exactly one of the six channel schemas, chosen by the request channel. A field that belongs to another channel is not part of this object. Pass the fields to your provider. Ignore unknown optional fields. If content is missing, return a non-202. If a retry changes rendered content for an id already accepted, keep the first content and do not deliver a second message.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/crm_messageEmailContent"
              },
              {
                "$ref": "#/components/schemas/crm_messageSmsContent"
              },
              {
                "$ref": "#/components/schemas/crm_messageOnSiteContent"
              },
              {
                "$ref": "#/components/schemas/crm_messageWebPushContent"
              },
              {
                "$ref": "#/components/schemas/crm_messageInAppContent"
              },
              {
                "$ref": "#/components/schemas/crm_messageRichInboxContent"
              }
            ]
          },
          "contact": {
            "description": "Address for this channel. Omitted, not null, unless Include Contact Point is on. Include Contact Point is off by default. There is no target field. An omitted contact means you resolve the address from playerId. On-site and rich inbox never send contact. When the object is present, it is exactly one of the four shapes, chosen by channel. Deliver to that address. Do not replace it with a different address. When it is absent, do not expect null. PEP does not send an empty list. A player with an empty web-push or in-app list is left out of the batch. Do not echo contact on the callback.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/crm_messageEmailContact"
              },
              {
                "$ref": "#/components/schemas/crm_messageSmsContact"
              },
              {
                "$ref": "#/components/schemas/crm_messageWebPushContact"
              },
              {
                "$ref": "#/components/schemas/crm_messageInAppContact"
              }
            ]
          }
        }
      },
      "crm_messageEmailContact": {
        "title": "email",
        "type": "object",
        "description": "Contact when channel is email and Include Contact Point is on. Include Contact Point is off by default. Deliver to this mailbox. Do not replace it.",
        "required": [
          "email"
        ],
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "description": "Mailbox. Example: alex@example.com."
          }
        },
        "example": {
          "email": "alex@example.com"
        }
      },
      "crm_messageSmsContact": {
        "title": "sms",
        "type": "object",
        "description": "Contact when channel is sms and Include Contact Point is on. Include Contact Point is off by default. Deliver to this number. There is no from number in content. You use your own sender.",
        "required": [
          "phone"
        ],
        "additionalProperties": false,
        "properties": {
          "phone": {
            "type": "string",
            "description": "Mobile number. Example: +50688887777."
          }
        },
        "example": {
          "phone": "+50688887777"
        }
      },
      "crm_messageWebPushContact": {
        "title": "web_push",
        "type": "object",
        "description": "Contact when channel is web_push and Include Contact Point is on. Include Contact Point is off by default. Deliver to these endpoints. PEP never sends an empty array.",
        "required": [
          "endpoints"
        ],
        "additionalProperties": false,
        "properties": {
          "endpoints": {
            "type": "array",
            "minItems": 1,
            "description": "Web-push subscription URLs.",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "endpoints": [
            "https://operator.example/push/1"
          ]
        }
      },
      "crm_messageInAppContact": {
        "title": "push_in_app",
        "type": "object",
        "description": "Contact when channel is push_in_app and Include Contact Point is on. Include Contact Point is off by default. Deliver to these subscriptions. PEP never sends an empty array.",
        "required": [
          "subscriptionIds"
        ],
        "additionalProperties": false,
        "properties": {
          "subscriptionIds": {
            "type": "array",
            "minItems": 1,
            "description": "In-app subscription ids.",
            "items": {
              "type": "string"
            }
          }
        },
        "example": {
          "subscriptionIds": [
            "sub-1"
          ]
        }
      },
      "crm_messageEmailContent": {
        "title": "email",
        "type": "object",
        "description": "Content when channel is email. Required: subject, html, fromEmail. Optional: fromName, replyTo. There is no text, no bcc, and no language. Optional fields are omitted, not null.",
        "required": [
          "subject",
          "html",
          "fromEmail"
        ],
        "additionalProperties": true,
        "properties": {
          "subject": {
            "type": "string",
            "description": "The rendered subject line. Use it as the email subject. A missing subject on an email item is a non-202. A retry that changes subject for an id already accepted must not send a second email."
          },
          "html": {
            "type": "string",
            "description": "The rendered HTML body. Send it as the HTML body. Do not treat it as plain text. There is no separate text part. A missing html on an email item is a non-202."
          },
          "fromEmail": {
            "type": "string",
            "description": "The From address. A missing fromEmail on an email item is a non-202."
          },
          "fromName": {
            "type": "string",
            "description": "Optional. The From display name. Omitted, not null, when PEP has no display name. Use it when present. Do not invent a name when it is absent."
          },
          "replyTo": {
            "type": "string",
            "description": "Optional. The reply-to address. Omitted, not null, when PEP has no reply address. Use it when present. Do not invent one when it is absent."
          }
        },
        "example": {
          "subject": "Your weekend bonus is ready",
          "html": "<p>Hello, your bonus is ready.</p>",
          "fromEmail": "crm@operator.example",
          "fromName": "Operator CRM"
        }
      },
      "crm_messageSmsContent": {
        "title": "sms",
        "type": "object",
        "description": "Content when channel is sms. Required: text. There is no from. You use your own sender.",
        "required": [
          "text"
        ],
        "additionalProperties": true,
        "properties": {
          "text": {
            "type": "string",
            "description": "The rendered SMS body. There is no from. You use your own sender. A missing text on an SMS item is a non-202. A retry that changes text for an id already accepted must not send a second SMS."
          }
        },
        "example": {
          "text": "Your bonus is ready."
        }
      },
      "crm_messageOnSiteContent": {
        "title": "on_site",
        "type": "object",
        "description": "Content when channel is on_site. Required: contentHtml, language. Optional: templateType, isHtmlContent. There is no title and no body. This channel never includes contact. The recipient is playerId. Optional fields are omitted, not null.",
        "required": [
          "contentHtml",
          "language"
        ],
        "additionalProperties": true,
        "properties": {
          "contentHtml": {
            "type": "string",
            "description": "The rendered HTML body. Show it as the on-site notification. It is not the email html field. A missing contentHtml is a non-202."
          },
          "language": {
            "type": "string",
            "description": "A language code such as en. Use it to select the player locale. A missing language is a non-202. Email and SMS do not send language."
          },
          "templateType": {
            "type": "string",
            "description": "Optional. The template type. It is not items[].type. Omitted, not null, when PEP has no template type. Store it when present. Do not read items[].type as the template type."
          },
          "isHtmlContent": {
            "type": "boolean",
            "description": "Optional. True when contentHtml is HTML. Omitted, not null, when PEP has no flag. Render HTML when true. When it is absent, follow your default for on-site content."
          }
        },
        "example": {
          "contentHtml": "<p>Hello, your bonus is ready.</p>",
          "language": "en",
          "templateType": "POPUP",
          "isHtmlContent": true
        }
      },
      "crm_messageWebPushContent": {
        "title": "web_push",
        "type": "object",
        "description": "Content when channel is web_push. Required: title, body. Optional: url, icon, image, actions. Optional fields are omitted, not null. There is no text part.",
        "required": [
          "title",
          "body"
        ],
        "additionalProperties": true,
        "properties": {
          "title": {
            "type": "string",
            "description": "The notification title. Email uses subject, not title. On-site has no title. A missing title is a non-202."
          },
          "body": {
            "type": "string",
            "description": "The notification body. A missing body is a non-202. Rich inbox does not use body."
          },
          "url": {
            "type": "string",
            "description": "Optional. The URL the notification opens when the player activates it. Omitted, not null, when PEP has no link. This is not callback.url."
          },
          "icon": {
            "type": "string",
            "description": "Optional. An icon URL. Omitted, not null, when PEP has no icon. Show it when present."
          },
          "image": {
            "type": "string",
            "description": "Optional. An image URL. Omitted, not null, when PEP has no image. Show it when present. Rich inbox uses imageUrl, not image."
          },
          "actions": {
            "type": "array",
            "description": "Optional. Buttons on the notification. Omitted, not null, when PEP has no actions. Do not send an empty array back to PEP.",
            "items": {
              "$ref": "#/components/schemas/crm_messageWebPushAction"
            }
          }
        },
        "example": {
          "title": "Bonus ready",
          "body": "Your weekend bonus is ready.",
          "url": "https://operator.example/bonus",
          "actions": [
            {
              "title": "Claim",
              "action": "claim"
            }
          ]
        }
      },
      "crm_messageInAppContent": {
        "title": "push_in_app",
        "type": "object",
        "description": "Content when channel is push_in_app. Required: title, body, language. Optional: url, icon, image. Optional fields are omitted, not null.",
        "required": [
          "title",
          "body",
          "language"
        ],
        "additionalProperties": true,
        "properties": {
          "title": {
            "type": "string",
            "description": "The notification title. A missing title is a non-202."
          },
          "body": {
            "type": "string",
            "description": "The notification body. A missing body is a non-202."
          },
          "language": {
            "type": "string",
            "description": "A language code such as en. Use it to select the player locale. A missing language is a non-202."
          },
          "url": {
            "type": "string",
            "description": "Optional. The URL the notification opens when the player activates it. Omitted, not null, when PEP has no link. This is not callback.url."
          },
          "icon": {
            "type": "string",
            "description": "Optional. An icon URL. Omitted, not null, when PEP has no icon. Show it when present."
          },
          "image": {
            "type": "string",
            "description": "Optional. An image URL. Omitted, not null, when PEP has no image. Show it when present. Rich inbox uses imageUrl, not image."
          }
        },
        "example": {
          "title": "Bonus ready",
          "body": "Your weekend bonus is ready.",
          "language": "en"
        }
      },
      "crm_messageRichInboxContent": {
        "title": "rich_inbox",
        "type": "object",
        "description": "Content when channel is rich_inbox. Required: title, message, contentHtml. Optional: language, templateType, displayType, buttonText, buttonUrl, imageUrl, terms, snackbarIcon, snackbarText, snackbarButtonText, snackbarContentHtml. There is no body and no html. imageUrl is not the web-push image field. This channel never includes contact. The recipient is playerId. Optional fields are omitted, not null.",
        "required": [
          "title",
          "message",
          "contentHtml"
        ],
        "additionalProperties": true,
        "properties": {
          "title": {
            "type": "string",
            "description": "The inbox title. A missing title is a non-202."
          },
          "message": {
            "type": "string",
            "description": "The short summary shown with the title. A missing message is a non-202."
          },
          "contentHtml": {
            "type": "string",
            "description": "The rendered HTML body. Show it as the inbox body. It is not the email html field. A missing contentHtml is a non-202."
          },
          "language": {
            "type": "string",
            "description": "Optional. A language code such as en, sent when the template has a language. Omitted, not null, when absent. Use it to select the player locale."
          },
          "templateType": {
            "type": "string",
            "description": "Optional. The template type. It is not items[].type. Omitted, not null, when PEP has no template type."
          },
          "displayType": {
            "type": "string",
            "enum": [
              "SILENT_NOTIFICATION",
              "SNACKBAR_ON_SCREEN"
            ],
            "description": "Optional. SILENT_NOTIFICATION or SNACKBAR_ON_SCREEN. Sent when the template has a display type. Choose the silent or snackbar presentation. Use the snackbar fields when the value is SNACKBAR_ON_SCREEN."
          },
          "buttonText": {
            "type": "string",
            "description": "Optional. Button label. Omitted, not null, when absent. Show the button when present."
          },
          "buttonUrl": {
            "type": "string",
            "description": "Optional. URL the button opens. Omitted, not null, when absent."
          },
          "imageUrl": {
            "type": "string",
            "description": "Optional. Image URL. Omitted, not null, when absent. This is not the web-push or in-app image field."
          },
          "terms": {
            "type": "string",
            "description": "Optional. Terms text. Omitted, not null, when absent. Show it when present."
          },
          "snackbarIcon": {
            "type": "string",
            "description": "Optional. Icon used when displayType is SNACKBAR_ON_SCREEN. Omitted, not null, when absent."
          },
          "snackbarText": {
            "type": "string",
            "description": "Optional. Text used when displayType is SNACKBAR_ON_SCREEN. Omitted, not null, when absent."
          },
          "snackbarButtonText": {
            "type": "string",
            "description": "Optional. Button label used when displayType is SNACKBAR_ON_SCREEN. Omitted, not null, when absent."
          },
          "snackbarContentHtml": {
            "type": "string",
            "description": "Optional. HTML used when displayType is SNACKBAR_ON_SCREEN. Omitted, not null, when absent. It is not contentHtml."
          }
        },
        "example": {
          "title": "Bonus ready",
          "message": "Your weekend bonus is ready.",
          "contentHtml": "<p>Hello, your bonus is ready.</p>",
          "language": "en",
          "displayType": "SNACKBAR_ON_SCREEN"
        }
      },
      "crm_messageWebPushAction": {
        "type": "object",
        "description": "One web-push action button.",
        "required": [
          "title",
          "action"
        ],
        "properties": {
          "title": {
            "type": "string",
            "description": "Label the player sees on the action. Required on each action object."
          },
          "action": {
            "type": "string",
            "description": "Action id your client handles when the player selects the button. Required on each action object. Example: claim."
          },
          "icon": {
            "type": "string",
            "description": "Optional icon URL for this action. Omitted, not null, when PEP has no icon for the action."
          }
        }
      },
      "ResponseHttpErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error summary."
          },
          "request": {
            "$ref": "#/components/schemas/ResponseRequest"
          },
          "details": {
            "$ref": "#/components/schemas/HttpResponseDetails"
          }
        }
      },
      "ResponseRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Request URL that failed."
          },
          "method": {
            "type": "string",
            "description": "HTTP method that failed."
          }
        }
      },
      "HttpResponseDetails": {
        "type": "object",
        "properties": {
          "faultCode": {
            "type": "integer",
            "format": "int32",
            "description": "Your fault code for this error."
          },
          "fields": {
            "type": "array",
            "description": "Fields that failed validation. One entry per field.",
            "items": {
              "$ref": "#/components/schemas/ResponseField"
            }
          }
        }
      },
      "ResponseField": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "Field path that failed. Example: items[0].playerDeliverId."
          },
          "error": {
            "type": "string",
            "description": "Why that field failed."
          }
        }
      },
      "crm_messageInternalErrorResponse": {
        "type": "object",
        "properties": {
          "faultCode": {
            "type": "integer",
            "format": "int32",
            "description": "Your fault code for the internal error."
          },
          "message": {
            "type": "string",
            "description": "Error summary. Do not include player addresses or rendered message bodies."
          }
        }
      }
    }
  }
}
