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

# Update ApiKey

> Update a user by ID



## OpenAPI

````yaml PATCH /auth/v1/apikeys/{id}
openapi: 3.1.0
info:
  title: OpenAPI Developer Portal
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api-dev.meeamitech.com
security:
  - bearerAuth: []
paths:
  /auth/v1/apikeys/{id}:
    patch:
      description: Update a user by ID
      parameters:
        - name: id
          in: path
          description: ID of the user to update
          required: true
          schema:
            type: string
      requestBody:
        description: API key details to be created
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the API key.
                isPublic:
                  type: boolean
                  description: Whether the API key is public.
                allowedOrigins:
                  type: array
                  items:
                    type: string
                  description: >-
                    List of allowed origins (only required if isPublic is
                    false).
                expiresAt:
                  type: string
                  format: date-time
                  description: Expiration date of the API key.
              required:
                - name
                - isPublic
              oneOf:
                - properties:
                    isPublic:
                      enum:
                        - true
                  required: []
                - properties:
                    isPublic:
                      enum:
                        - false
                    allowedOrigins:
                      type: array
                      items:
                        type: string
                      minItems: 1
                      description: >-
                        Allowed origins must be provided if the API key is not
                        public.
                  required:
                    - allowedOrigins
            example:
              name: Suresh
              isPublic: true
        required: true
      responses:
        '200':
          description: User updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeys'
              example:
                message: API key is updated successfully
                data:
                  _id: 67c52a1526865c41a282c4e9
                  teamId: 67a2ea1d828c9098134e7b92
                  name: Suresh
                  key: 3289e233-93f7-411e-9d06-308c26fc278f
                  createdAt: '2025-03-03T03:58:10.357+00:00'
                  expiresAt: '2025-03-10T04:03:33.131+00:00'
                  uuid: 67af1bcea4f8dca74f0d51b0
                  isPublic: true
components:
  schemas:
    ApiKeys:
      required:
        - id
        - key
        - name
        - teamId
        - uuid
        - isPublic
        - createdAt
        - expiresAt
      type: object
      properties:
        id:
          type: string
        key:
          type: string
        teamId:
          type: string
        uuid:
          type: string
        isPublic:
          type: boolean
        createdAt:
          type: string
        expiresAt:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````