> ## Documentation Index
> Fetch the complete documentation index at: https://docs.contentmod.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Moderate Text



## OpenAPI

````yaml POST /text
openapi: 3.0.0
info:
  version: 1.0.0
  title: ContentMod Api
servers:
  - url: https://api.contentmod.io
security: []
paths:
  /text:
    post:
      requestBody:
        description: The text to moderate
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  type: string
                  minLength: 1
                  example: This is a very cool api
                options:
                  type: object
                  properties:
                    meta:
                      type: object
                      properties: {}
                    callbackUrl:
                      type: string
                      format: uri
                    defer:
                      type: boolean
                    actorId:
                      type: string
                    bannedWords:
                      type: array
                      items:
                        type: string
              required:
                - text
      responses:
        '200':
          description: Response of the moderated text
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The id of the text moderation
                    example: 27fbdc0b-b295-46ce-93f5-81b2fc08a381
                  isSafe:
                    type: boolean
                    description: Whether the text is considered safe
                    example: true
                  confidence:
                    type: number
                    description: Confidence of the safety of the text from 1-100
                    example: 90
                  sentiment:
                    type: string
                    enum:
                      - positive
                      - negative
                      - neutral
                    description: >-
                      Sentiment of the text, either negative, neutral or
                      positive
                    example: positive
                  sentimentScore:
                    type: number
                    description: Sentiment score from 1-100 (negative, neutral, positive)
                    example: 90
                  riskScores:
                    type: object
                    properties:
                      overall:
                        type: number
                        description: Overall risk score from 1-100
                        example: 90
                      spam:
                        type: number
                        description: Score from 1-100 wether the text is spam
                        example: 90
                      toxicity:
                        type: number
                        description: Score from 1-100 wether the text is malicious/toxic
                        example: 90
                    required:
                      - overall
                      - spam
                      - toxicity
                  topics:
                    type: array
                    items:
                      type: string
                    description: >-
                      General topics the text depicts, lowercase and no
                      punctuation
                    example:
                      - politics
                      - sports
                  nsfwCategories:
                    type: array
                    items:
                      type: object
                      properties:
                        category:
                          type: string
                          description: The category
                          example: sexual
                        severity:
                          type: number
                          description: Severity level of the category from 1-100
                          example: 90
                      required:
                        - category
                        - severity
                    example:
                      - category: sexual
                        severity: 90
                  summary:
                    type: object
                    properties:
                      profanity:
                        type: boolean
                        description: Whether the content contains profanity.
                        example: true
                      totalFlags:
                        type: number
                        description: Total flags
                        example: 1
                      contentRating:
                        type: string
                        description: >-
                          Content rating of the text (e.g. G, PG, PG-13, R,
                          NC-17)
                        example: G
                      language:
                        type: string
                        description: The language code of the text, eg. en, fr, de
                        example: en
                    required:
                      - profanity
                      - totalFlags
                      - contentRating
                      - language
                  suggestedActions:
                    type: object
                    properties:
                      reject:
                        type: boolean
                        description: Whether to reject the text
                        example: true
                      review:
                        type: boolean
                        description: Whether to flag the text
                        example: true
                    required:
                      - reject
                      - review
                  filteredContent:
                    type: string
                    description: The text with profanity replaced by *.
                    example: This is a filtered text
                  content:
                    type: string
                    description: The original text
                    example: This is the original text
                  request:
                    type: object
                    properties:
                      requestId:
                        type: string
                        description: The id of the request
                        example: 27fbdc0b-b295-46ce-93f5-81b2fc08a381
                      timestamp:
                        type: string
                        description: The timestamp of the request
                        example: '2023-04-05T12:00:00.000Z'
                    required:
                      - requestId
                      - timestamp
                  meta:
                    nullable: true
                    description: The metadata of the request
                    example: This is the metadata
                  hash:
                    type: string
                    description: SHA-256 hash of the text
                    example: >-
                      93a08bd10cd367bf83f12ba6590fcaef2f8deec8a47ce4ce88a15c7dda325ffa
                required:
                  - id
                  - isSafe
                  - confidence
                  - sentiment
                  - sentimentScore
                  - riskScores
                  - topics
                  - nsfwCategories
                  - summary
                  - suggestedActions
                  - filteredContent
                  - content
                  - request
                  - hash
        '201':
          description: Returns 201 moderation created with the id
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                required:
                  - id
      security:
        - Bearer: []
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````