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

# Update wordlist

> Update a wordlist



## OpenAPI

````yaml put /wordlist/{id}
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
  - name: Voice
    description: Real-time voice moderation over WebSocket.
externalDocs:
  url: https://docs.moderationapi.com
paths:
  /wordlist/{id}:
    put:
      tags:
        - wordlist
      summary: Update wordlist
      description: Update a wordlist
      operationId: wordlist-update
      parameters:
        - in: path
          name: id
          schema:
            type: string
            description: ID of the wordlist to update
          required: true
          description: ID of the wordlist to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  description: New name for the wordlist
                  type: string
                key:
                  description: New key for the wordlist
                  type: string
                description:
                  description: New description for the wordlist
                  type: string
                words:
                  description: >-
                    New words for the wordlist. Replace the existing words with
                    these new ones. Duplicate words will be ignored.
                  type: array
                  items:
                    type: string
                strict:
                  description: Deprecated. Now using threshold in project settings.
                  type: boolean
      responses:
        '200':
          description: Wordlist updated 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/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 wordlist = await client.wordlist.update('id');

            console.log(wordlist.id);
        - 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
            )
            wordlist = client.wordlist.update(
                id="id",
            )
            print(wordlist.id)
        - lang: Ruby
          source: >-
            require "moderation_api"


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


            wordlist = moderation_api.wordlist.update("id")


            puts(wordlist)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use ModerationAPI\Client;

            use ModerationAPI\Core\Exceptions\APIException;


            $client = new Client(secretKey: getenv('MODAPI_SECRET_KEY') ?: 'My
            Secret Key');


            try {
              $wordlist = $client->wordlist->update(
                'id',
                description: 'description',
                key: 'key',
                name: 'name',
                strict: true,
                words: ['string'],
              );

              var_dump($wordlist);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using System;
            using ModerationApi;
            using ModerationApi.Models.Wordlist;

            ModerationApiClient client = new();

            WordlistUpdateParams parameters = new() { ID = "id" };

            var wordlist = await client.Wordlist.Update(parameters);

            Console.WriteLine(wordlist);
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

````