

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Vivox Safe Text APIs",
    "version": "2.0.0",
    "description": "## Overview\n\nThe Vivox Safe Text APIs send batches of chat messages to the Vivox Safe Text filter for processing.",
    "contact": {
      "name": "devs-vivox-server"
    }
  },
  "tags": [
    {
      "name": "Vivox"
    }
  ],
  "servers": [
    {
      "url": "https://vivox.services.api.unity.com/safe-text/v2"
    }
  ],
  "paths": {
    "/organizations/{organizationId}/projects/{projectId}/environments/{environmentId}/batch": {
      "post": {
        "summary": "Send Bulk Messages to Filter",
        "operationId": "postBatchFilter",
        "description": "Run a batch of messages through the environment's adaptive chat filter (SafeText) and return each message with its filtered text and whether it was flagged.",
        "tags": [
          "Vivox"
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "Organization ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "Project ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "description": "Environment ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "description": "List of messages to be sent for filtering",
                    "items": {
                      "type": "object",
                      "required": [
                        "message"
                      ],
                      "properties": {
                        "message": {
                          "type": "string",
                          "description": "The message to be sent for filtering"
                        },
                        "session_id": {
                          "type": "string",
                          "description": "Session id to attribute the message to. A random test id is used when omitted."
                        },
                        "user_id": {
                          "type": "string",
                          "description": "User id to attribute the message to. A random test id is used when omitted."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "results"
                  ],
                  "properties": {
                    "results": {
                      "type": "array",
                      "nullable": true,
                      "description": "List of results for each message",
                      "items": {
                        "type": "object",
                        "required": [
                          "original_message",
                          "filtered_message",
                          "flag"
                        ],
                        "properties": {
                          "filtered_message": {
                            "type": "string",
                            "description": "The result of the filter for the message"
                          },
                          "original_message": {
                            "type": "string",
                            "description": "The original message before filtering"
                          },
                          "flag": {
                            "type": "boolean",
                            "description": "Whether the filter flagged the message"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request body is invalid, or the filter rejected it",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/VivoxErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "The chat filter feature is not enabled for this project environment",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/VivoxErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "The organization does not own the project",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/VivoxErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VivoxInternalError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic",
        "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, your service account must have the vivox.safe_text_admin.update permission."
      }
    },
    "schemas": {
      "VivoxErrorBody": {
        "type": "object",
        "description": "RFC 7807 problem returned by the Vivox facade",
        "required": [
          "title",
          "detail",
          "status"
        ],
        "properties": {
          "title": {
            "type": "string",
            "example": "Not Found"
          },
          "detail": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "example": 404
          },
          "details": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "missingFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "VivoxInternalError": {
        "type": "object",
        "description": "Generic internal error returned by the Vivox facade",
        "required": [
          "msg"
        ],
        "properties": {
          "msg": {
            "type": "string",
            "example": "internal server error"
          }
        }
      }
    }
  }
}
```