> ## 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 the name on an account invitation. The email address cannot be changed.



## OpenAPI

````yaml put /account-invitations/{id}
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:
  /account-invitations/{id}:
    put:
      tags:
        - Account Invitations
      summary: Update account invitation
      description: >-
        Update the name on an account invitation. The email address cannot be
        changed.
      operationId: updateAccountInvitation
      parameters:
        - $ref: '#/components/parameters/id'
      requestBody:
        description: Invitation to update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountInvitationUpdateRequest'
      responses:
        '200':
          description: Updated account invitation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountInvitationResponse'
        '401':
          $ref: '#/components/responses/AccountTokenRequired'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    id:
      name: id
      in: path
      description: ID of the resource
      required: true
      schema:
        type: string
  schemas:
    AccountInvitationUpdateRequest:
      type: object
      properties:
        account_invitation:
          $ref: '#/components/schemas/AccountInvitationUpdate'
      required:
        - account_invitation
      example:
        account_invitation:
          name: Grace Hopper
    AccountInvitationResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/AccountInvitation'
    AccountInvitationUpdate:
      type: object
      properties:
        name:
          type: string
          description: Name of the user the invitation is for
      required:
        - name
    AccountInvitation:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: Name of the user the invitation is for
        email:
          type: string
          format: email
          description: Email address of the user
        invite_url:
          type: string
          description: URL the invited user follows to accept the invitation
        roles:
          $ref: '#/components/schemas/Roles'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        invited_by:
          type:
            - object
            - 'null'
          description: >-
            The user who sent the invitation. Empty when it was created via the
            API.
          properties:
            id:
              type: string
            name:
              type: string
            email:
              type: string
              format: email
      example:
        id: inv123
        name: Grace Hopper
        email: newmember@cookiechimp.com
        invite_url: https://cookiechimp.com/account_invitations/inv123
        roles:
          admin: true
        created_at: '2023-01-25T09:30:20Z'
        updated_at: '2023-01-25T09:30:20Z'
        invited_by:
          id: usr123
          name: Ada Lovelace
          email: admin@example.com
    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
    ValidationError:
      type: object
      description: |
        Returned when a create or update fails validation. Each entry carries a
        single human-readable `error` string.
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              error:
                type: string
      example:
        errors:
          - error: Name can't be blank
    Roles:
      type: object
      description: |
        Role flags for a membership. Currently `admin` is the only role, and it
        defaults to `true`.
      additionalProperties:
        type: boolean
      example:
        admin: true
  responses:
    AccountTokenRequired:
      description: |
        Missing or invalid API token, or a token that does not resolve to an
        account. Account-scoped endpoints accept an account token, or a user
        token whose user belongs to an account; partner tokens are rejected.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 401
                message: API key must belong to an account
    NotFound:
      description: The record does not exist, or does not belong to the caller
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            errors:
              - code: 404
                message: Record not found
    ValidationError:
      description: The record could not be saved
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    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

````