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

> Endpoint to create a new context type associated with the authenticated tenant.

Args:
    context_type (ContextTypeCreate): The request body containing the context type definition.

Returns:
    ContextType: The created context type object.

Raises:
    HTTPException 400: If input validation fails
    HTTPException 409: If the context type creation fails due to a runtime error.



## OpenAPI

````yaml post /api/context-type
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:
    post:
      tags:
        - Context Type
      summary: Context Type Create
      description: >-
        Endpoint to create a new context type associated with the authenticated
        tenant.


        Args:
            context_type (ContextTypeCreate): The request body containing the context type definition.

        Returns:
            ContextType: The created context type object.

        Raises:
            HTTPException 400: If input validation fails
            HTTPException 409: If the context type creation fails due to a runtime error.
      operationId: context_type_create
      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}'

````