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

# Update account invitation

> Update account invitation by ID



## OpenAPI

````yaml put /account-invitations/{id}
openapi: 3.1.0
info:
  title: CookieChimp API
  description: API for CookieChimp.com
  version: 1.0.1
servers:
  - url: https://cookiechimp.com/api/v1
security:
  - authorization: []
paths:
  /account-invitations/{id}:
    put:
      tags:
        - Account Invitations
      summary: Update account invitation
      description: Update account invitation by ID
      operationId: updateAccountInvitation
      parameters:
        - $ref: '#/components/parameters/id'
      requestBody:
        description: Account invitation to update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountInvitationUpdate'
      responses:
        '200':
          description: Updated account invitation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountInvitation'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    id:
      name: id
      in: path
      description: ID of the resource
      required: true
      schema:
        type: string
  schemas:
    AccountInvitationUpdate:
      type: object
      properties:
        name:
          type: string
          description: Name of the user the invitation is for
        role:
          type: string
          enum:
            - admin
            - member
          description: Role of the user when they accept the invitation
      required:
        - name
        - role
    AccountInvitation:
      type: object
      allOf:
        - $ref: '#/components/schemas/AccountInvitationCreate'
      properties:
        id:
          type: string
        email:
          type: string
          format: email
          description: Email address of the user
        invited_by_type:
          type: string
          description: Type of entity that created the invitation (account_user or API)
        invited_by_id:
          type: string
          nullable: true
          description: ID of the user who created the invitation
        created_at:
          type: string
          format: date-time
          description: Date and time when the invitation was created
        updated_at:
          type: string
          format: date-time
          description: Date and time when the invitation was last updated
        deleted_at:
          type: string
          format: date-time
          description: Date and time when the invitation was cancelled
      example:
        id: inv123
        email: newmember@cookiechimp.com
        role: member
        invited_by_type: API
        created_at: '2023-01-25T09:30:20Z'
        updated_at: '2023-01-25T09:30:20Z'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
      example:
        error:
          code: 400
          message: Invalid request
    AccountInvitationCreate:
      type: object
      properties:
        name:
          type: string
          description: Name of the user the invitation is for
        email:
          type: string
          format: email
          description: Email address of the user
        role:
          type: string
          enum:
            - admin
            - member
          description: Role of the user when they accept the invitation
      required:
        - name
        - email
        - role
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      description: API token obtained from the login endpoint or the dashboard

````