

```json
{
  "openapi": "3.0.0",
  "info": {
    "contact": {
      "email": "banasco@unity3d.com",
      "name": "Banasco"
    },
    "description": "## Overview\n\nAPI for managing Trigger configurations and Dead Letter Queue (DLQ) events.\n\n### Limits\n\n- One event type can be associated with a maximum of 32 triggers.\n- Processing of events in order is not guaranteed.\n- Supports at-least-once delivery semantics. This means that all events are guaranteed to be processed once, but may occasionally be processed multiple times due to network issues.\n- Triggers do not interact with the return value of the defined action. You should account for this and execute your game logic in the script or module itself.\n- Cloud Code scripts or modules that rely on external calls using client-side authentication don't work due to the lack of a player context. Refer to Set up Cloud Code: Context attributes for more information.\n- Cloud Code script and module execution timeouts still apply.\n- If your trigger interacts with the same service that emits the event, you should define a filter to avoid infinite loops. Infinite loops overprocess the event, cause unexpected behavior in your game, and eventually exhaust your Cloud Code resources for the project, which can lead to a service outage. If you encounter this issue, delete the trigger that causes the loop.\n\n### RBAC\nThe following roles are available for `user` accounts:\n\n| Role Name                       | Scope   | Description                                        |\n|---------------------------------|---------|----------------------------------------------------|\n| `Triggers Configuration Viewer` | Project | Grants read-only access to project configurations. |\n| `Triggers Configuration Editor` | Project | Grants full access to project configurations.      |\n| `Triggers DLQ Viewer`           | Project | Grants read-only access to the project's DLQ.      |\n| `Triggers DLQ Manager`          | Project | Grants full access for managing project's DLQ.     |\n\n### Useful Links\n- [Documentation](https://docs.unity.com/en-us/cloud-code/triggers/overview)\n",
    "title": "Triggers Admin API",
    "version": "1.0"
  },
  "servers": [
    {
      "description": "Prd",
      "url": "https://services.api.unity.com/triggers/v1"
    }
  ],
  "paths": {
    "/projects/{projectId}/environments/{environmentId}/configs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/EnvironmentId"
        }
      ],
      "get": {
        "description": "List project's environment existing Triggers",
        "operationId": "listTriggerConfigs",
        "parameters": [
          {
            "description": "The number of triggers to display per page",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "A token to get the next page",
            "in": "query",
            "name": "after",
            "schema": {
              "default": null,
              "nullable": true,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": {
                      "after": "MjAyMy0wNS0wOVQxMzo1OTozNFp8MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAw",
                      "configs": [
                        {
                          "actionType": "cloud-code",
                          "actionUrn": "urn:ugs:cloud-code:MyTestScript",
                          "createdAt": "2023-02-28T12:30:22.590279Z",
                          "eventType": "com.unity.services.leaderboards.score-submitted.v1",
                          "filter": "data[\"leaderboardId\"] == \"my-first-leaderboard\"",
                          "id": "00000000-0000-0000-0000-000000000001",
                          "name": "Trigger Test 1",
                          "updatedAt": "2023-02-28T12:30:22.590279Z"
                        },
                        {
                          "actionType": "cloud-code",
                          "actionUrn": "urn:ugs:cloud-code:MyTestScript",
                          "createdAt": "2023-03-01T11:45:40.036455Z",
                          "eventType": "com.unity.services.scheduler.example-event-2.v1",
                          "id": "00000000-0000-0000-0000-000000000002",
                          "name": "Trigger Test 2",
                          "updatedAt": "2023-03-01T11:45:40.036455Z"
                        },
                        {
                          "actionType": "webhook",
                          "actionUrn": "urn:ugs:webhook",
                          "createdAt": "2023-03-01T11:45:40.036455Z",
                          "eventType": "com.unity.services.scheduler.example-event-3.v1",
                          "id": "00000000-0000-0000-0000-000000000003",
                          "name": "Trigger Test 3",
                          "updatedAt": "2023-03-01T11:45:40.036455Z"
                        }
                      ],
                      "limit": 2
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/TriggerConfigPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "ServiceAccount": [
              "triggers.configs.list"
            ]
          }
        ],
        "summary": "List existing Triggers Config",
        "tags": [
          "Triggers"
        ]
      },
      "post": {
        "description": "Add Trigger to the project's environment",
        "operationId": "createTriggerConfig",
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "Trigger": {
                  "value": {
                    "actionType": "cloud-code",
                    "actionUrn": "urn:ugs:cloud-code:MyTestScript",
                    "eventType": "com.unity.services.scheduler.example-event.v1",
                    "name": "example-trigger-name"
                  }
                },
                "Trigger with Webhook": {
                  "value": {
                    "actionType": "webhook",
                    "actionUrn": "urn:ugs:webhook",
                    "eventType": "com.unity.services.scheduler.example-event.v1",
                    "name": "example-trigger-name",
                    "webhook": {
                      "headers": {
                        "Content-Type": "application/json"
                      },
                      "method": "POST",
                      "payloadTemplate": "{\"message\": \"Hello, world!\"}",
                      "url": "https://example.com"
                    }
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/TriggerConfigBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerConfig"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/LimitExceeded"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "ServiceAccount": [
              "triggers.configs.create"
            ]
          }
        ],
        "summary": "Create Trigger Config",
        "tags": [
          "Triggers"
        ]
      }
    },
    "/projects/{projectId}/environments/{environmentId}/configs/{configId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/EnvironmentId"
        },
        {
          "description": "ID of the trigger config. IDs can be retrieved by listing the triggers configurations.",
          "example": "00000000-0000-0000-0000-000000000000",
          "in": "path",
          "name": "configId",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        }
      ],
      "get": {
        "description": "Get the project's environment's Trigger",
        "operationId": "getTriggerConfig",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": {
                      "actionType": "cloud-code",
                      "actionUrn": "urn:ugs:cloud-code:MyTestScript",
                      "createdAt": "2023-02-28T12:30:22.590279Z",
                      "environmentId": "00000000-0000-0000-0000-000000000000",
                      "eventType": "com.unity.services.leaderboards.score-submitted.v1",
                      "filter": "data[\"leaderboardId\"] == \"my-first-leaderboard\"",
                      "id": "00000000-0000-0000-0000-000000000000",
                      "name": "Trigger Test",
                      "projectId": "00000000-0000-0000-0000-000000000000",
                      "updatedAt": "2023-02-28T12:30:22.590279Z"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/TriggerConfig"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "ServiceAccount": [
              "triggers.configs.get"
            ]
          }
        ],
        "summary": "Get Trigger Config",
        "tags": [
          "Triggers"
        ]
      },
      "delete": {
        "description": "Delete the project's environment's Trigger",
        "operationId": "deleteTriggerConfig",
        "responses": {
          "200": {
            "description": "OK"
          },
          "204": {
            "description": "No Content"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "ServiceAccount": [
              "triggers.configs.delete"
            ]
          }
        ],
        "summary": "Delete Trigger Config",
        "tags": [
          "Triggers"
        ]
      }
    },
    "/projects/{projectId}/environments/{environmentId}/dlq": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/EnvironmentId"
        }
      ],
      "get": {
        "description": "List failed events in the Dead Letter Queue for the project environment",
        "operationId": "listDLQEvents",
        "parameters": [
          {
            "description": "Maximum number of events to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor for the next page",
            "in": "query",
            "name": "after",
            "schema": {
              "nullable": true,
              "type": "string"
            }
          },
          {
            "description": "Filter events created on or after this timestamp (RFC3339)",
            "in": "query",
            "name": "createdFrom",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Filter events created on or before this timestamp (RFC3339)",
            "in": "query",
            "name": "createdTo",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Filter events by status (pending, replay_queued, processing, resolved)",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter events by resolution action (replayed, discarded). Only applies to resolved events.",
            "in": "query",
            "name": "resolutionAction",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter events by original CloudEvent ID",
            "in": "query",
            "name": "eventId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DLQEventPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "ServiceAccount": [
              "triggers.dlq.list"
            ]
          }
        ],
        "summary": "List DLQ Events",
        "tags": [
          "DLQ"
        ]
      }
    },
    "/projects/{projectId}/environments/{environmentId}/dlq/{eventId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/EnvironmentId"
        },
        {
          "$ref": "#/components/parameters/DLQEventId"
        }
      ],
      "get": {
        "description": "Get a specific DLQ event by ID",
        "operationId": "getDLQEvent",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DLQEvent"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/DLQEventNotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "ServiceAccount": [
              "triggers.dlq.get"
            ]
          }
        ],
        "summary": "Get DLQ Event",
        "tags": [
          "DLQ"
        ]
      }
    },
    "/projects/{projectId}/environments/{environmentId}/dlq/{eventId}/discard": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/EnvironmentId"
        },
        {
          "$ref": "#/components/parameters/DLQEventId"
        }
      ],
      "post": {
        "description": "Mark an event as discarded without reprocessing",
        "operationId": "discardDLQEvent",
        "responses": {
          "200": {
            "description": "OK"
          },
          "204": {
            "description": "Event discarded successfully"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/DLQEventNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "ServiceAccount": [
              "triggers.dlq.discard"
            ]
          }
        ],
        "summary": "Discard DLQ Event",
        "tags": [
          "DLQ"
        ]
      }
    },
    "/projects/{projectId}/environments/{environmentId}/dlq/{eventId}/replay": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/EnvironmentId"
        },
        {
          "$ref": "#/components/parameters/DLQEventId"
        }
      ],
      "post": {
        "description": "Queue a failed event for replay.",
        "operationId": "replayDLQEvent",
        "responses": {
          "200": {
            "description": "OK"
          },
          "204": {
            "description": "Event queued for replay"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/DLQEventNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "ServiceAccount": [
              "triggers.dlq.replay"
            ]
          }
        ],
        "summary": "Replay DLQ Event",
        "tags": [
          "DLQ"
        ]
      }
    },
    "/projects/{projectId}/environments/{environmentId}/dlq/discard": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/EnvironmentId"
        }
      ],
      "post": {
        "description": "Mark all pending events in the DLQ as discarded. This is an immediate operation.",
        "operationId": "discardAllDLQEvents",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DLQDiscardResult"
                }
              }
            },
            "description": "Events discarded successfully"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "ServiceAccount": [
              "triggers.dlq.discard"
            ]
          }
        ],
        "summary": "Discard All Pending DLQ Events",
        "tags": [
          "DLQ"
        ]
      }
    },
    "/projects/{projectId}/environments/{environmentId}/dlq/replay": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProjectId"
        },
        {
          "$ref": "#/components/parameters/EnvironmentId"
        }
      ],
      "post": {
        "description": "Queue all pending events in the DLQ for replay.",
        "operationId": "replayAllDLQEvents",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DLQQueuedResult"
                }
              }
            },
            "description": "Events queued for replay"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "ServiceAccount": [
              "triggers.dlq.replay"
            ]
          }
        ],
        "summary": "Replay All Pending DLQ Events",
        "tags": [
          "DLQ"
        ]
      }
    }
  },
  "components": {
    "parameters": {
      "DLQEventId": {
        "description": "ID of the DLQ event",
        "example": "550e8400-e29b-41d4-a716-446655440000",
        "in": "path",
        "name": "eventId",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "EnvironmentId": {
        "description": "The Environment ID of a project",
        "in": "path",
        "name": "environmentId",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "ProjectId": {
        "description": "The project's [Project ID](https://docs.unity.com/en-us/cloud/projects/create-project)",
        "in": "path",
        "name": "projectId",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "content": {
          "application/problem+json": {
            "schema": {
              "discriminator": {
                "mapping": {
                  "problems/basic": "#/components/schemas/BadRequestErrorResponse",
                  "problems/validation": "#/components/schemas/ValidationErrorResponse"
                },
                "propertyName": "type"
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                },
                {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              ]
            }
          }
        },
        "description": "Bad Request. Returned code indicates one of:\n- Request parameter validation failure\n- Other\nSee the errors field for more details.\n"
      },
      "Conflict": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ConflictErrorResponse"
            }
          }
        },
        "description": "Conflict"
      },
      "DLQEventNotFound": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/DLQEventNotFoundErrorResponse"
            }
          }
        },
        "description": "DLQ Event Not Found"
      },
      "InternalServerError": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/InternalServerErrorResponse"
            }
          }
        },
        "description": "Internal Server Error"
      },
      "LimitExceeded": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/LimitExceededErrorResponse"
            }
          }
        },
        "description": "Trigger limit per event type exceeded"
      },
      "NotFound": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/NotFoundErrorResponse"
            }
          }
        },
        "description": "Not Found"
      },
      "ServiceUnavailable": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ServiceUnavailableErrorResponse"
            }
          }
        },
        "description": "Service Unavailable"
      },
      "TooManyRequests": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/TooManyRequestsErrorResponse"
            }
          }
        },
        "description": "Too Many Requests",
        "headers": {
          "Retry-After": {
            "description": "The number of seconds until a request will be accepted",
            "schema": {
              "type": "number"
            }
          }
        }
      },
      "Unauthorized": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/UnauthorizedErrorResponse"
            }
          }
        },
        "description": "Invalid Authentication Token"
      }
    },
    "schemas": {
      "BadRequestErrorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BasicErrorResponse"
          },
          {
            "example": {
              "code": 55,
              "detail": "Failed to parse request body. Error: Unexpected end of JSON input",
              "status": 400,
              "title": "Bad Request",
              "type": "problems/basic"
            },
            "title": "BadRequestErrorResponse",
            "type": "object"
          }
        ]
      },
      "BasicErrorResponse": {
        "description": "Referenced from - https://tools.ietf.org/html/rfc7807#page-3\nConsumers MUST use the 'type' string as the primary identifier for the problem type; the 'title' string is advisory and included only for users who are not aware of the semantics of the URI and do not have the ability to discover them (e.g., offline log analysis). Consumers SHOULD NOT automatically dereference the type URI.\nThe \"status\" member, if present, is only advisory; it conveys the HTTP status code used for the convenience of the consumer. Generators MUST use the same status code in the actual HTTP response, to assure that generic HTTP software that does not understand this format still behaves correctly.  See Section 5 for further caveats regarding its use.\nConsumers can use the status member to determine what the original status code used by the generator was, in cases where it has been changed (e.g., by an intermediary or cache), and when message bodies persist without HTTP information.  Generic HTTP software will still use the HTTP status code.\nThe \"detail\" member, if present, ought to focus on helping the client correct the problem, rather than giving debugging information.\n",
        "properties": {
          "code": {
            "description": "Service specific error code",
            "type": "integer"
          },
          "detail": {
            "description": "A human-readable explanation specific to this occurrence of the problem.",
            "type": "string"
          },
          "instance": {
            "description": "A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.",
            "type": "integer"
          },
          "title": {
            "description": "A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).",
            "type": "string"
          },
          "type": {
            "description": "A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be \"about:blank\".",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "title": "BasicErrorResponse",
        "type": "object"
      },
      "ConflictErrorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BasicErrorResponse"
          },
          {
            "example": {
              "code": 58,
              "detail": "Trigger config already exists with the same name",
              "status": 409,
              "title": "Conflict",
              "type": "problems/basic"
            },
            "title": "ConflictErrorResponse",
            "type": "object"
          }
        ]
      },
      "DLQDiscardResult": {
        "properties": {
          "discardedCount": {
            "description": "Number of events discarded",
            "type": "integer"
          }
        },
        "title": "DLQDiscardResult",
        "type": "object"
      },
      "DLQEvent": {
        "properties": {
          "correlationId": {
            "description": "Correlation ID linking related events across replays",
            "format": "uuid",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "environmentId": {
            "$ref": "#/components/schemas/EnvironmentId"
          },
          "eventId": {
            "description": "Original CloudEvent ID",
            "format": "uuid",
            "type": "string"
          },
          "eventType": {
            "description": "Original CloudEvent type. Required for replay.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "$ref": "#/components/schemas/DLQEventId"
          },
          "metadata": {
            "additionalProperties": true,
            "description": "Event metadata including trigger information",
            "type": "object"
          },
          "payload": {
            "additionalProperties": true,
            "description": "Original event payload",
            "type": "object"
          },
          "projectId": {
            "$ref": "#/components/schemas/ProjectId"
          },
          "resolutionAction": {
            "description": "Action taken to resolve the event (replayed, discarded, or null if pending)",
            "nullable": true,
            "type": "string"
          },
          "sourceType": {
            "description": "Type of source that generated the event (webhook, triggers)",
            "type": "string"
          },
          "status": {
            "description": "Current status of the DLQ event (pending, replay_queued, processing, resolved)",
            "type": "string"
          },
          "subject": {
            "description": "Original CloudEvent subject, if set",
            "nullable": true,
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "title": "DLQEvent",
        "type": "object",
        "x-examples": {
          "Pending Event": {
            "correlationId": "123e4567-e89b-12d3-a456-426614174000",
            "createdAt": "2026-02-02T12:00:00Z",
            "environmentId": "00000000-0000-0000-0000-000000000000",
            "eventId": "123e4567-e89b-12d3-a456-426614174001",
            "eventType": "com.unity.services.player-auth.signed-in.v1",
            "id": "550e8400-e29b-41d4-a716-446655440000",
            "metadata": {
              "environmentId": "00000000-0000-0000-0000-000000000000",
              "projectId": "00000000-0000-0000-0000-000000000000"
            },
            "payload": {
              "amount": 100,
              "playerId": "player-123"
            },
            "projectId": "00000000-0000-0000-0000-000000000000",
            "resolutionAction": null,
            "sourceType": "webhook",
            "status": "pending",
            "subject": "dlq-e2e-test",
            "updatedAt": "2026-02-02T12:00:00Z"
          }
        }
      },
      "DLQEventId": {
        "description": "Unique identifier for a DLQ event",
        "format": "uuid",
        "type": "string"
      },
      "DLQEventNotFoundErrorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BasicErrorResponse"
          },
          {
            "example": {
              "code": 36001,
              "detail": "DLQ event not found",
              "status": 404,
              "title": "Not Found",
              "type": "problems/basic"
            },
            "title": "DLQEventNotFoundErrorResponse",
            "type": "object"
          }
        ]
      },
      "DLQEventPage": {
        "properties": {
          "after": {
            "nullable": true,
            "type": "string"
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/DLQEvent"
            },
            "type": "array"
          },
          "limit": {
            "type": "integer"
          }
        },
        "title": "DLQEventPage",
        "type": "object"
      },
      "DLQQueuedResult": {
        "properties": {
          "queuedCount": {
            "description": "Number of events queued for replay",
            "type": "integer"
          }
        },
        "title": "DLQQueuedResult",
        "type": "object"
      },
      "EnvironmentId": {
        "format": "uuid",
        "type": "string"
      },
      "InternalServerErrorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BasicErrorResponse"
          },
          {
            "example": {
              "detail": "An unknown error occurred",
              "status": 500,
              "title": "Internal Server Error",
              "type": "problems/basic"
            },
            "title": "InternalServerErrorResponse",
            "type": "object"
          }
        ]
      },
      "LimitExceededErrorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BasicErrorResponse"
          },
          {
            "example": {
              "code": 36000,
              "detail": "Trigger limit per event type exceeded",
              "status": 422,
              "title": "Unprocessable Entity",
              "type": "problems/basic"
            },
            "title": "problems/basic",
            "type": "object"
          }
        ]
      },
      "NotFoundErrorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BasicErrorResponse"
          },
          {
            "example": {
              "code": 54,
              "detail": "Trigger config not found",
              "status": 404,
              "title": "Not Found",
              "type": "problems/basic"
            },
            "title": "NotFoundErrorResponse",
            "type": "object"
          }
        ]
      },
      "ProjectId": {
        "format": "uuid",
        "type": "string"
      },
      "ServiceUnavailableErrorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BasicErrorResponse"
          },
          {
            "example": {
              "code": 3,
              "detail": "service health ping failed",
              "status": 503,
              "title": "Service Unavailable",
              "type": "problems/basic"
            },
            "title": "ServiceUnavailableErrorResponse",
            "type": "object"
          }
        ]
      },
      "TooManyRequestsErrorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BasicErrorResponse"
          },
          {
            "example": {
              "detail": "Too many requests",
              "status": 429,
              "title": "Too Many Requests",
              "type": "problems/basic"
            },
            "title": "TooManyRequestsErrorResponse",
            "type": "object"
          }
        ]
      },
      "TriggerActionScopeType": {
        "description": "Scope type of the endpoint this trigger targets, as declared by the caller at creation time.\nOmit the field (or send `null`) to signal \"no scope\" -- the triggers service drops the event\nscope before dispatching the action. When set (e.g. `Player`, `MultiplayerSession`), the\nevent scope is forwarded to the action executor unchanged. An empty string is not accepted;\nomit the field instead.\n",
        "maxLength": 128,
        "minLength": 1,
        "nullable": true,
        "type": "string",
        "x-examples": {
          "Multiplayer session": "MultiplayerSession",
          "Player": "Player"
        }
      },
      "TriggerActionType": {
        "description": "Type of action performed on event occurrence. Currently supported types are: [cloud-code, webhook]",
        "type": "string"
      },
      "TriggerActionUrn": {
        "description": "A URN description the action that should be taken on event occurrences",
        "type": "string",
        "x-examples": {
          "Cloud Code Module": "urn:ugs:cloud-code:MyTestModule/MyEntrypoint",
          "Cloud Code Script": "urn:ugs:cloud-code:MyTestScript"
        }
      },
      "TriggerConfig": {
        "description": "",
        "properties": {
          "actionScopeType": {
            "$ref": "#/components/schemas/TriggerActionScopeType"
          },
          "actionType": {
            "$ref": "#/components/schemas/TriggerActionType"
          },
          "actionUrn": {
            "$ref": "#/components/schemas/TriggerActionUrn"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "environmentId": {
            "$ref": "#/components/schemas/EnvironmentId"
          },
          "eventType": {
            "$ref": "#/components/schemas/TriggerEventType"
          },
          "filter": {
            "$ref": "#/components/schemas/TriggerFilter"
          },
          "id": {
            "$ref": "#/components/schemas/TriggerId"
          },
          "name": {
            "$ref": "#/components/schemas/TriggerName"
          },
          "projectId": {
            "$ref": "#/components/schemas/ProjectId"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "webhook": {
            "$ref": "#/components/schemas/WebhookConfig"
          }
        },
        "title": "TriggerConfig",
        "type": "object",
        "x-examples": {
          "Trigger": {
            "actionType": "cloud-code",
            "actionUrn": "urn:ugs:cloud-code:MyTestScript",
            "createdAt": "2023-02-28T12:30:22.590279Z",
            "environmentId": "00000000-0000-0000-0000-000000000000",
            "eventType": "com.unity.services.leaderboards.score-submitted.v1",
            "filter": "data[\"leaderboardId\"] == \"my-first-leaderboard\"",
            "id": "00000000-0000-0000-0000-000000000000",
            "name": "Trigger Test",
            "projectId": "00000000-0000-0000-0000-000000000000",
            "updatedAt": "2023-02-28T12:30:22.590279Z"
          },
          "Trigger with Webhook": {
            "actionType": "webhook",
            "actionUrn": "urn:ugs:webhook",
            "createdAt": "2023-02-28T12:30:22.590279Z",
            "environmentId": "00000000-0000-0000-0000-000000000000",
            "eventType": "com.unity.services.leaderboards.score-submitted.v1",
            "filter": "data[\"leaderboardId\"] == \"my-first-leaderboard\"",
            "id": "00000000-0000-0000-0000-000000000000",
            "name": "Trigger With Webhook Test",
            "projectId": "00000000-0000-0000-0000-000000000000",
            "updatedAt": "2023-02-28T12:30:22.590279Z",
            "webhook": {
              "headers": {
                "Content-Type": "application/json"
              },
              "method": "POST",
              "url": "https://example.com"
            }
          }
        }
      },
      "TriggerConfigBody": {
        "properties": {
          "actionScopeType": {
            "$ref": "#/components/schemas/TriggerActionScopeType"
          },
          "actionType": {
            "$ref": "#/components/schemas/TriggerActionType"
          },
          "actionUrn": {
            "$ref": "#/components/schemas/TriggerActionUrn"
          },
          "eventType": {
            "$ref": "#/components/schemas/TriggerEventType"
          },
          "filter": {
            "$ref": "#/components/schemas/TriggerFilter"
          },
          "name": {
            "$ref": "#/components/schemas/TriggerName"
          },
          "webhook": {
            "$ref": "#/components/schemas/WebhookConfigBody"
          }
        },
        "required": [
          "name",
          "eventType",
          "actionUrn"
        ],
        "type": "object",
        "x-examples": {
          "Trigger": {
            "actionScopeType": "Player",
            "actionType": "cloud-code",
            "actionUrn": "urn:ugs:cloud-code:MyTestScript",
            "eventType": "com.unity.services.scheduler.example-event.v1",
            "name": "example-trigger-name"
          }
        }
      },
      "TriggerConfigListItem": {
        "description": "Trigger config as returned in list response.",
        "properties": {
          "actionScopeType": {
            "$ref": "#/components/schemas/TriggerActionScopeType"
          },
          "actionType": {
            "$ref": "#/components/schemas/TriggerActionType"
          },
          "actionUrn": {
            "$ref": "#/components/schemas/TriggerActionUrn"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "eventType": {
            "$ref": "#/components/schemas/TriggerEventType"
          },
          "filter": {
            "$ref": "#/components/schemas/TriggerFilter"
          },
          "id": {
            "$ref": "#/components/schemas/TriggerId"
          },
          "name": {
            "$ref": "#/components/schemas/TriggerName"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "webhook": {
            "$ref": "#/components/schemas/WebhookConfig"
          }
        },
        "title": "TriggerConfigListItem",
        "type": "object"
      },
      "TriggerConfigPage": {
        "properties": {
          "after": {
            "type": "string"
          },
          "configs": {
            "items": {
              "$ref": "#/components/schemas/TriggerConfigListItem"
            },
            "type": "array"
          },
          "limit": {
            "type": "integer"
          }
        },
        "type": "object",
        "x-examples": {
          "Success": {
            "after": "MjAyMy0wNS0wOVQxMzo1OTozNFp8MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAw",
            "configs": [
              {
                "actionType": "cloud-code",
                "actionUrn": "urn:ugs:cloud-code:MyTestScript",
                "createdAt": "2023-02-28T12:30:22.590279Z",
                "eventType": "com.unity.services.scheduler.example-event.v1",
                "id": "00000000-0000-0000-0000-000000000000",
                "name": "Trigger Test",
                "updatedAt": "2023-02-28T12:30:22.590279Z"
              }
            ],
            "limit": 1
          }
        }
      },
      "TriggerEventType": {
        "description": "Type of the event that should trigger the configured action",
        "type": "string",
        "x-examples": {
          "Scheduled Example Event": "com.unity.services.scheduler.example-event.v1"
        }
      },
      "TriggerFilter": {
        "description": "Define a simple expression using Common Expression Language (https://github.com/google/cel-spec/blob/master/README.md) to apply to the incoming event payload. If the expression result is \"true\" the trigger action will be executed.",
        "type": "string",
        "x-examples": {
          "Trigger specific Leaderboard action": "data[\"leaderboardId\"] == \"my-first-leaderboard\""
        }
      },
      "TriggerId": {
        "format": "uuid",
        "type": "string"
      },
      "TriggerName": {
        "description": "Display name for the trigger configuration",
        "maxLength": 255,
        "minLength": 1,
        "type": "string"
      },
      "UnauthorizedErrorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BasicErrorResponse"
          },
          {
            "example": {
              "code": 1005,
              "status": 401,
              "title": "Unauthorized",
              "type": "problems/basic"
            },
            "title": "UnauthorizedErrorResponse",
            "type": "object"
          }
        ]
      },
      "ValidationError": {
        "description": "Single error in the Validation Error Response.",
        "properties": {
          "field": {
            "type": "string"
          },
          "messages": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "field",
          "messages"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "ValidationErrorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BasicErrorResponse"
          },
          {
            "description": "Validation error response when a value provided from the client does not pass validation on server.",
            "example": {
              "code": 55,
              "detail": "See 'errors' for specific validation errors",
              "errors": [
                {
                  "field": "string",
                  "messages": [
                    "parameter is required"
                  ]
                }
              ],
              "instance": null,
              "status": 400,
              "title": "Validation error",
              "type": "problems/validation"
            },
            "properties": {
              "errors": {
                "items": {
                  "$ref": "#/components/schemas/ValidationError"
                },
                "type": "array"
              }
            },
            "title": "ValidationErrorResponse",
            "type": "object"
          }
        ],
        "required": [
          "type",
          "title",
          "status",
          "code",
          "detail",
          "errors"
        ]
      },
      "WebhookConfig": {
        "description": "Webhook configuration. Only present when actionType requires webhook configuration.",
        "properties": {
          "headers": {
            "$ref": "#/components/schemas/WebhookHeaders"
          },
          "method": {
            "$ref": "#/components/schemas/WebhookMethod"
          },
          "payloadTemplate": {
            "$ref": "#/components/schemas/WebhookPayloadTemplate"
          },
          "url": {
            "$ref": "#/components/schemas/WebhookURL"
          }
        },
        "title": "WebhookConfig",
        "type": "object"
      },
      "WebhookConfigBody": {
        "description": "Webhook configuration. Only present when actionType requires webhook configuration.",
        "properties": {
          "headers": {
            "$ref": "#/components/schemas/WebhookHeaders"
          },
          "method": {
            "$ref": "#/components/schemas/WebhookMethod"
          },
          "payloadTemplate": {
            "$ref": "#/components/schemas/WebhookPayloadTemplate"
          },
          "url": {
            "$ref": "#/components/schemas/WebhookURL"
          }
        },
        "title": "WebhookConfigBody",
        "type": "object"
      },
      "WebhookHeaders": {
        "description": "The headers of the webhook. At most 10 custom header entries are allowed. Available template functions: `secret` (retrieve a secret by key), `hmac_sha256` (sign the request body with HMAC-SHA256), `hmac_sha512` (sign the request body with HMAC-SHA512), `jwt` (mint a JWT token). Example: `Basic {{ secret \"auth-token\" }}` or `Bearer {{ jwt }}` or `{{ hmac_sha256 \"my-signing-key\" }}`",
        "type": "object"
      },
      "WebhookMethod": {
        "description": "The method of the webhook",
        "type": "string"
      },
      "WebhookPayloadTemplate": {
        "description": "The payload template of the webhook. Maximum length is 100000 characters (approximately 100 KB for ASCII content). Available template functions: `secret` (retrieve a secret by key). Example: `{\"key\": \"{{ secret \"my-secret\" }}\"}`",
        "type": "string"
      },
      "WebhookURL": {
        "description": "The URL of the webhook. Maximum length is 2048 characters. Available template functions: `secret` (retrieve a secret by key). Example: `https://example.com/{{ secret \"my-api-key\" }}`",
        "type": "string"
      }
    },
    "securitySchemes": {
      "ServiceAccount": {
        "description": "To get started with Authentication, please visit the [Service Account Authentication section](https://services.docs.unity.com/docs/service-account-auth).\n\nFor this API, you will need to add the following role(s) to your service account :\n\n| Role Type | Role Name | Permissions |\n| --- | --- | --- |\n| Project Level Role | Triggers Configuration Viewer | <ul><li>triggers.configs.get</li><li>triggers.configs.list</li></ul> |\n| Project Level Role | Triggers Configuration Editor | <ul><li>triggers.configs.get</li><li>triggers.configs.list</li><li>triggers.configs.create</li><li>triggers.configs.delete</li></ul> |\n| Project Level Role | Triggers DLQ Viewer | <ul><li>triggers.dlq.get</li><li>triggers.dlq.list</li></ul> |\n| Project Level Role | Triggers DLQ Manager | <ul><li>triggers.dlq.get</li><li>triggers.dlq.list</li><li>triggers.dlq.replay</li><li>triggers.dlq.discard</li></ul> |",
        "scheme": "basic",
        "type": "http"
      }
    }
  },
  "tags": [
    {
      "description": "Endpoints associated with the Triggers API",
      "name": "Triggers"
    },
    {
      "description": "Dead Letter Queue management for failed events",
      "name": "DLQ"
    }
  ]
}
```