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

# Create a context

> Create a context from a name and its text. It is attached to every
simulation planned against it, so simulation inputs need not repeat it.



## OpenAPI

````yaml https://api.semilattice.ai/openapi.json post /v1/contexts
openapi: 3.1.0
info:
  title: Semilattice API
  description: API for human behaviour simulation.
  contact:
    name: Semilattice API
    url: https://semilattice.ai/
    email: support@semilattice.ai
  version: v1.0.0
servers: []
security: []
paths:
  /v1/contexts:
    post:
      tags:
        - Context
      summary: Create a context
      description: |-
        Create a context from a name and its text. It is attached to every
        simulation planned against it, so simulation inputs need not repeat it.
      operationId: create_context_route_v1_contexts_post
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            type: string
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateContextBody'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateContextBody:
      properties:
        name:
          type: string
          title: Name
          description: A short name, e.g. the product's name
        body:
          type: string
          title: Body
          description: >-
            Markdown describing the organisation or product: what it is, who
            uses it, what it competes with, how it is priced
      type: object
      required:
        - name
        - body
      title: CreateContextBody
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.