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

# Change password

> Change the password of the user the API token belongs to. The current
password must be supplied. Requires a user API token.




## OpenAPI

````yaml put /password
openapi: 3.1.0
info:
  title: CookieChimp API
  description: |
    API for CookieChimp.com.

    ## Request bodies

    Resource endpoints expect the resource wrapped under its own key, e.g.
    `{"category": {"name": "Analytics"}}` rather than a bare object.
    `PUT /password` wraps in `user`. `POST /auth` is the exception: it takes
    `email` and `password` at the top level.

    ## Response envelopes

    Listing endpoints — including `GET /groups` and `GET /accounts` — return
    `{"pagination": {...}, "data": [...]}`. Most single-resource endpoints
    return `{"data": {...}}`; a single group or account is returned unwrapped.
    Resource-deletion endpoints return `{"message": "..."}`; `DELETE /auth`
    returns an empty object.
  version: 1.2.0
servers:
  - url: https://cookiechimp.com/api/v1
security:
  - authorization: []
paths:
  /password:
    put:
      tags:
        - Auth
      summary: Change password
      description: |
        Change the password of the user the API token belongs to. The current
        password must be supplied. Requires a user API token.
      operationId: updatePassword
      requestBody:
        description: Current and new password
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PasswordUpdateRequest'
      responses:
        '200':
          description: Password changed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
              example:
                success: true
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: The current password was wrong, or the new one was invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageError'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    PasswordUpdateRequest:
      type: object
      properties:
        user:
          type: object
          properties:
            current_password:
              type: string
              format: password
            password:
              type: string
              format: password
            password_confirmation:
              type: string
              format: password
          required:
            - current_password
            - password
            - password_confirmation
      required:
        - user
      example:
        user:
          current_password: correct-horse-battery-staple
          password: a-longer-new-password
          password_confirmation: a-longer-new-password
    MessageError:
      type: object
      description: >-
        Returned by the auth and password endpoints, which use a single `error`
        string.
      properties:
        error:
          type: string
      example:
        error: Invalid Email or password.
    Error:
      type: object
      description: |
        The standard error envelope, used for authentication, authorization,
        pagination and not-found errors.
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: integer
              message:
                type: string
      example:
        errors:
          - code: 401
            message: Invalid API Key
  responses:
    Unauthorized:
      description: Missing, invalid or expired API token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 401
                message: Invalid API Key
    RateLimited:
      description: |
        Too many requests. The general limit is 300 requests per 5 minutes per
        API token; the auth endpoints are throttled more tightly per IP.
      headers:
        Retry-After:
          description: Seconds until the current rate-limit window resets
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 429
                message: Too many requests. Please retry later.
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      description: API token obtained from the login endpoint or the dashboard

````