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

# Create wordlist

> Create a wordlist in the organization. You can add words now or later. Each word is embedded in the background for similarity matching. Use the embedding status endpoint to follow the progress. To use the wordlist in moderation, add it to a policy.



## OpenAPI

````yaml post /wordlist
openapi: 3.1.0
info:
  title: Moderation API
  description: >-
    Moderate text, images, video and audio in real time, manage authors, review
    queues and actions, and receive webhooks.
  version: 1.1.0
servers:
  - url: https://api.moderationapi.com/v1
security: []
tags:
  - name: Content
    description: Submit content for moderation.
  - name: Authors
    description: The users who create content, with their trust level and history.
  - name: Review queues
    description: Queues of content for human review, and their items.
  - name: Actions
    description: Moderation actions reviewers and rules can take.
  - name: Wordlists
    description: Custom word and phrase lists used by policies.
  - name: Webhooks
    description: Endpoints that receive events, and the events they receive.
  - name: Analytics
    description: Moderation numbers for a project, as on the dashboard overview.
  - name: Account
    description: The account that owns the API key.
  - name: Projects
    description: Projects in the organization. Needs an organization key.
  - name: Channels
    description: Channels in a project. Needs an organization key.
  - name: Voice
    description: Real-time voice moderation over WebSocket.
  - name: Feedback
    description: Send feature requests and product feedback to the Moderation API team.
externalDocs:
  url: https://docs.moderationapi.com
paths:
  /wordlist:
    post:
      tags:
        - Wordlists
      summary: Create wordlist
      description: >-
        Create a wordlist in the organization. You can add words now or later.
        Each word is embedded in the background for similarity matching. Use the
        embedding status endpoint to follow the progress. To use the wordlist in
        moderation, add it to a policy.
      operationId: createWordlist
      parameters:
        - in: header
          name: Project-Id
          required: false
          schema:
            type: string
          description: >-
            The project to act on, by ID or name. Required with an organization
            key unless the key reaches only one project; list projects with GET
            /projects. A project key acts on its own project and needs no value:
            naming another one is an error.
          x-speakeasy-name-override: projectId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Name of the wordlist
                key:
                  description: >-
                    Key of the wordlist. Default: made from the name. If the key
                    is already in use, a suffix is added.
                  type: string
                description:
                  description: Description of the wordlist
                  type: string
                words:
                  description: >-
                    Words to add to the wordlist. Words are converted to
                    lowercase. Duplicate and empty words are ignored. Maximum
                    5000 words.
                  type: array
                  items:
                    type: string
              required:
                - name
      responses:
        '200':
          description: Wordlist created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ID of the wordlist
                  name:
                    anyOf:
                      - type: string
                        description: Name of the wordlist
                      - type: 'null'
                  words:
                    type: array
                    items:
                      type: string
                    description: Words in the wordlist
                  createdAt:
                    description: Creation date of the wordlist
                    type: string
                  organizationId:
                    type: string
                    description: ID of the organization
                  userId:
                    anyOf:
                      - type: string
                        description: ID of the user
                      - type: 'null'
                  strict:
                    type: boolean
                    description: Strict mode
                required:
                  - id
                  - name
                  - words
                  - createdAt
                  - organizationId
                  - userId
                  - strict
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '429':
          description: >-
            Too many requests. Retry after the number of seconds in the
            `Retry-After` header.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
      security:
        - Authorization: []
components:
  schemas:
    BadRequestError:
      type: object
      description: The request is malformed or a parameter is invalid.
      properties:
        type:
          type: string
          const: invalid_request_error
          description: Broad error category. Stable; safe to switch on.
        code:
          type: string
          enum:
            - invalid_request
            - project_id_required
            - project_name_ambiguous
            - validation_failed
          x-speakeasy-unknown-values: allow
          description: >-
            Exactly what went wrong. Stable; safe to branch on. New codes may be
            added.


            - `invalid_request`: A parameter is invalid. `message` says which
            one.

            - `project_id_required`: An organization key called a project
            endpoint without naming the project in `Project-Id`, and the key
            reaches more than one project. `message` lists the projects it
            reaches.

            - `project_name_ambiguous`: The name in `Project-Id` fits more than
            one project the key reaches. `message` lists them; name the project
            by ID instead.

            - `validation_failed`: The request body does not match the schema.
            `issues` lists each problem with its `path`.
          example: invalid_request
        message:
          type: string
          description: Human-readable explanation.
          example: Invalid input data
        issues:
          type: array
          items:
            $ref: '#/components/schemas/ErrorIssue'
          description: Validation problems, when the request body is invalid.
        request_id:
          type: string
          description: Identifies this request. Include it when you contact support.
          example: h8fkz6kkzoa446ffve37atys
        doc_url:
          type: string
          format: uri
          description: Documentation for this `code`.
      required:
        - type
        - code
        - message
        - request_id
        - doc_url
    AuthenticationError:
      type: object
      description: The API key is missing, invalid or revoked.
      properties:
        type:
          type: string
          const: authentication_error
          description: Broad error category. Stable; safe to switch on.
        code:
          type: string
          enum:
            - unauthorized
            - missing_api_key
            - malformed_api_key
            - invalid_api_key
          x-speakeasy-unknown-values: allow
          description: >-
            Exactly what went wrong. Stable; safe to branch on. New codes may be
            added.


            - `unauthorized`: Authentication failed.

            - `missing_api_key`: No API key in the `Authorization` header.

            - `malformed_api_key`: The `Authorization` header does not contain a
            valid key format.

            - `invalid_api_key`: The API key does not exist or was revoked.
          example: unauthorized
        message:
          type: string
          description: Human-readable explanation.
          example: Authorization not provided
        issues:
          type: array
          items:
            $ref: '#/components/schemas/ErrorIssue'
          description: Validation problems, when the request body is invalid.
        request_id:
          type: string
          description: Identifies this request. Include it when you contact support.
          example: h8fkz6kkzoa446ffve37atys
        doc_url:
          type: string
          format: uri
          description: Documentation for this `code`.
      required:
        - type
        - code
        - message
        - request_id
        - doc_url
    RateLimitError:
      type: object
      description: >-
        Too many requests. Retry after the number of seconds in the
        `Retry-After` header.
      properties:
        type:
          type: string
          const: rate_limit_error
          description: Broad error category. Stable; safe to switch on.
        code:
          type: string
          enum:
            - rate_limit_exceeded
          x-speakeasy-unknown-values: allow
          description: >-
            Exactly what went wrong. Stable; safe to branch on. New codes may be
            added.


            - `rate_limit_exceeded`: Too many requests. Wait for the
            `Retry-After` seconds.
          example: rate_limit_exceeded
        message:
          type: string
          description: Human-readable explanation.
          example: Rate limit exceeded
        issues:
          type: array
          items:
            $ref: '#/components/schemas/ErrorIssue'
          description: Validation problems, when the request body is invalid.
        request_id:
          type: string
          description: Identifies this request. Include it when you contact support.
          example: h8fkz6kkzoa446ffve37atys
        doc_url:
          type: string
          format: uri
          description: Documentation for this `code`.
      required:
        - type
        - code
        - message
        - request_id
        - doc_url
    ErrorIssue:
      type: object
      properties:
        message:
          type: string
          description: What is wrong.
        path:
          type: array
          items:
            anyOf:
              - type: string
              - type: number
          description: Location of the invalid field in the request body.
        code:
          type: string
          description: Validation rule that failed.
      required:
        - message
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      x-speakeasy-name-override: secretKey

````