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

# Context Type Update

> Endpoint to update an existing context type by its ID.

Args:
    context_type_id (str): The unique identifier of the context type to update.
    context_type_update (ContextTypeCreate): The updated context type data.

Returns:
    ContextType: The updated context type object.

Raises:
    HTTPException 400: If input validation fails
    HTTPException 404: If the context type with the given ID does not exist.
    HTTPException 500: If a runtime error occurs during the update process.



## OpenAPI

````yaml put /api/context-type/{context_type_id}
openapi: 3.1.0
info:
  title: Apigene
  description: Apigene API
  version: 1.0.0
  contact:
    name: Apigene Support
    url: https://app.apigene.ai
    email: support@apigene.ai
servers:
  - url: https://app.apigene.ai
security:
  - BearerAuth: []
paths:
  /api/context-type/{context_type_id}:
    put:
      tags:
        - Context Type
      summary: Context Type Update
      description: |-
        Endpoint to update an existing context type by its ID.

        Args:
            context_type_id (str): The unique identifier of the context type to update.
            context_type_update (ContextTypeCreate): The updated context type data.

        Returns:
            ContextType: The updated context type object.

        Raises:
            HTTPException 400: If input validation fails
            HTTPException 404: If the context type with the given ID does not exist.
            HTTPException 500: If a runtime error occurs during the update process.
      operationId: context_type_update
      parameters:
        - name: context_type_id
          in: path
          required: true
          schema:
            type: string
            title: Context Type Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContextTypeCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextType'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    ContextTypeCreate:
      properties:
        name:
          type: string
          title: Name
          description: Name of the context type
        summary:
          type: string
          title: Summary
          description: Summary of the context type
        description:
          type: string
          title: Description
          description: Detailed information on the context type
        when_to_use:
          type: string
          title: When To Use
          description: Explanation to agent when to use the context type
        how_to_generate:
          type: string
          title: How To Generate
          description: Explanation to agent how to generate new context of this type
      type: object
      required:
        - name
        - summary
        - description
        - when_to_use
        - how_to_generate
      title: ContextTypeCreate
    ContextType:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the context type
        name:
          type: string
          title: Name
          description: Name of the context type
        summary:
          type: string
          title: Summary
          description: Summary of the context type
        description:
          type: string
          title: Description
          description: Detailed information on the context type
        when_to_use:
          type: string
          title: When To Use
          description: Explanation to agent when to use the context type
        how_to_generate:
          type: string
          title: How To Generate
          description: Explanation to agent how to generate new context of this type
        created_by:
          type: string
          title: Created By
          description: User who created the context type
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The date and time when the context type was created.
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The date and time when the context type was last updated.
      type: object
      required:
        - id
        - name
        - summary
        - description
        - when_to_use
        - how_to_generate
        - created_by
        - created_at
        - updated_at
      title: ContextType
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        'Authorization: Bearer {token}'

````