> ## 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.

# Add words to wordlist

> Add words to an existing wordlist



## OpenAPI

````yaml post /wordlist/{id}/words
openapi: 3.1.0
info:
  title: Moderation API
  description: API for automated content moderation
  version: 1.1.0
servers:
  - url: https://api.moderationapi.com/v1
security: []
tags:
  - name: Actions
  - name: Queues
  - name: Webhooks
  - name: Wordlist
  - name: UserReports
externalDocs:
  url: https://docs.moderationapi.com
paths:
  /wordlist/{id}/words:
    post:
      tags:
        - wordlist
      summary: Add words to wordlist
      description: Add words to an existing wordlist
      operationId: wordlist-addWords
      parameters:
        - in: path
          name: id
          schema:
            type: string
            description: ID of the wordlist to add words to
          required: true
          description: ID of the wordlist to add words to
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                words:
                  type: array
                  items:
                    type: string
                  description: >-
                    Array of words to add to the wordlist. Duplicate words will
                    be ignored.
              required:
                - words
      responses:
        '200':
          description: Words successfully added to wordlist
          content:
            application/json:
              schema:
                type: object
                properties:
                  addedCount:
                    type: number
                    description: Number of words added
                  totalCount:
                    type: number
                    description: Total number of words in wordlist
                  addedWords:
                    type: array
                    items:
                      type: string
                    description: List of words that were added
                required:
                  - addedCount
                  - totalCount
                  - addedWords
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
      security:
        - Authorization: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import ModerationAPI from '@moderation-api/sdk';


            const client = new ModerationAPI({
              secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted
            });


            const response = await client.wordlist.words.add('id', { words:
            ['string'] });


            console.log(response.addedCount);
        - lang: Python
          source: |-
            import os
            from moderation_api import ModerationAPI

            client = ModerationAPI(
                secret_key=os.environ.get("MODAPI_SECRET_KEY"),  # This is the default and can be omitted
            )
            response = client.wordlist.words.add(
                id="id",
                words=["string"],
            )
            print(response.added_count)
        - lang: Ruby
          source: >-
            require "moderation_api"


            moderation_api = ModerationAPI::Client.new(secret_key: "My Secret
            Key")


            response = moderation_api.wordlist.words.add("id", words:
            ["string"])


            puts(response)
components:
  schemas:
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Invalid input data
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Invalid input data error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
    error.UNAUTHORIZED:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Authorization not provided
        code:
          type: string
          description: The error code
          example: UNAUTHORIZED
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Authorization not provided error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Authorization not provided
        issues: []
    error.NOT_FOUND:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Not found
        code:
          type: string
          description: The error code
          example: NOT_FOUND
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Not found error (404)
      description: The error information
      example:
        code: NOT_FOUND
        message: Not found
        issues: []
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````