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

# Create a context

> The context is created empty and is not queryable until you import sources and curate them (curate is explicit — there is no auto-curate). Optionally seed a `manifest`. A `work` context is the exception: it is queryable from day zero and is built from traces of work rather than source documents.



## OpenAPI

````yaml https://raw.githubusercontent.com/pinecone-io/pinecone-api/refs/heads/main/2026-07/nexus_2026-07.oas.yaml POST /contexts
openapi: 3.0.3
info:
  title: Nexus API
  contact:
    name: Pinecone Support
    url: https://support.pinecone.io
    email: support@pinecone.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 2026-07
  description: >
    Nexus turns a set of sources into a queryable, self-improving knowledge
    base. A context is **sources + a manifest**: upload sources, **curate** them
    into a searchable index (curate is explicit — there is no auto-curate), and
    then query the context. The manifest (a single validated JSON document)
    defines how the context indexes, retrieves, and answers.


    Conventions:


      * The `{slug}` path parameter accepts the URL-safe context slug **or**
        its UUID.

      * Contexts return a `ContextResponse` (derived flags), not the raw
        persisted model. Tasks return a `TaskResponse`.

      * Querying is the unified KnowQL Query API: `POST /api/query` runs one
        turn (`ask` in, answer out); multi-turn conversations are **sessions**
        (`GET/DELETE /api/sessions`, `GET /api/queries/{id}`). Read the
        answer from `output[].content[].text`.

      * Tasks are a top-level, project-owned resource at `/api/tasks` —
        they are no longer nested under contexts. Active workflow types are
        `optimize`, `curate`, `search`, `search_cc`, `search_rag`, `explore`,
        `profile`, `import`, `pack`, `restore`.
servers:
  - url: https://{host}/api
    description: Your Nexus deployment host
    variables:
      host:
        default: api.example.com
security:
  - bearerAuth: []
  - apiKey: []
tags:
  - name: Auth
    description: Login and identity.
  - name: Project
    description: The active Pinecone project and its disclosure state.
  - name: Contexts
    description: A context is sources + a manifest. Curate it explicitly before querying.
  - name: Manifest
    description: Manifest templates and the per-context manifest.
  - name: Source Files
    description: >-
      Per-context source imports (upload, connector, public repo) and the source
      file tree.
  - name: Knowledge
    description: Read-only browse of curated knowledge (chunks + artifacts).
  - name: Curation
    description: Curate workflow trigger, curation ledger, and version-pin primitives.
  - name: Connectors
    description: >-
      Project-level links to external source providers (Box, ...). Linked via
      OAuth or an API key, then used to import source documents into a context.
  - name: Query
    description: >-
      The unified KnowQL Query API: run a query turn (`/query`), fetch a turn
      (`/queries/{id}`), inspect its trace, manage feedback, comparison flags,
      and multi-turn sessions (`/sessions`).
  - name: Tasks
    description: >-
      Top-level, project-owned task records for every workflow (optimize,
      curate, search, work, explore, profile, import, pack, restore, groom).
  - name: Task Files
    description: Read, list, and delete files from live or archived task containers.
paths:
  /contexts:
    parameters:
      - $ref: '#/components/parameters/ApiVersionHeader'
    post:
      tags:
        - Contexts
      summary: Create a context
      description: >-
        The context is created empty and is not queryable until you import
        sources and curate them (curate is explicit — there is no auto-curate).
        Optionally seed a `manifest`. A `work` context is the exception: it is
        queryable from day zero and is built from traces of work rather than
        source documents.
      operationId: create_context
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateContextRequest'
      responses:
        '200':
          description: The created context
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          description: >-
            Project not enabled for the Nexus preview (`preview_not_enabled`),
            or a per-plan context cap blocks creation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Slug already exists
components:
  parameters:
    ApiVersionHeader:
      in: header
      name: X-Pinecone-Api-Version
      description: >-
        Date-based contract version. Omit to resolve to the Nexus default
        version (`2026-07`, the oldest served version); send `unstable` for the
        in-development surface. The resolved version is echoed back on the same
        header. A present-but-unrecognized value is rejected with `400
        unsupported_api_version`.
      required: false
      style: simple
      schema:
        type: string
        default: 2026-07
        x-enum:
          - 2026-07
          - unstable
  schemas:
    CreateContextRequest:
      type: object
      required:
        - slug
        - name
      properties:
        slug:
          type: string
          description: 3–64 chars, lowercase alnum + hyphens, starts with a letter
        name:
          type: string
          description: 1–128 chars
        description:
          type: string
        guide:
          type: string
        manifest:
          allOf:
            - $ref: '#/components/schemas/Manifest'
          description: Seed manifest (validated against the manifest schema)
        kind:
          $ref: '#/components/schemas/ContextKind'
    ContextResponse:
      type: object
      description: What context endpoints return (derived flags).
      required:
        - id
        - slug
        - name
        - kind
        - created_by
        - description
        - is_optimizing
        - has_sources
        - is_curating
        - is_importing
        - is_exploring
        - is_restoring
        - is_grooming
        - created_at
        - updated_at
      properties:
        id:
          type: string
        slug:
          type: string
        name:
          type: string
        kind:
          $ref: '#/components/schemas/ContextKind'
        workspace:
          type: string
          description: Present only on a workspace-enabled cluster
        created_by:
          type: string
        description:
          type: string
          nullable: true
        guide:
          type: string
          description: High-level guidance for the query runtime
        manifest:
          allOf:
            - $ref: '#/components/schemas/Manifest'
          description: Pinned manifest document; absent when the context is on defaults
        is_optimizing:
          type: boolean
        optimize_task_id:
          type: string
          nullable: true
        optimize_score:
          type: number
          format: double
          nullable: true
        optimize_iterations:
          type: integer
          nullable: true
        last_optimized_at:
          type: string
          format: date-time
          nullable: true
        last_curated_at:
          type: string
          format: date-time
          nullable: true
        has_sources:
          type: boolean
        last_source_import_at:
          type: string
          format: date-time
          nullable: true
        is_curating:
          type: boolean
        curate_task_id:
          type: string
          nullable: true
        is_importing:
          type: boolean
        import_task_id:
          type: string
          nullable: true
        is_exploring:
          type: boolean
        explore_task_id:
          type: string
          nullable: true
        is_restoring:
          type: boolean
        restore_task_id:
          type: string
          nullable: true
        manifest_suggestion:
          $ref: '#/components/schemas/ManifestSuggestion'
        sample_queries:
          type: array
          items:
            type: string
          description: Example questions the curated corpus can answer
        is_grooming:
          type: boolean
        groom_task_id:
          type: string
        groom_artifact_count:
          type: integer
          format: int64
        last_groomed_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        stats:
          allOf:
            - $ref: '#/components/schemas/ContextStats'
          description: Populated only on the list endpoint
    Error:
      type: object
      required:
        - message
      description: The error envelope every non-2xx response uses.
      properties:
        message:
          type: string
        code:
          type: string
          description: >-
            Stable machine-readable code, present only on errors a client must
            branch on. 
          x-enum:
            - unsupported_api_version
            - preview_not_enabled
            - preview_file_limit
            - preview_byte_limit
            - workspace_host_required
            - workspace_not_found
    Manifest:
      type: object
      description: >-
        The context manifest that drives curate and search. A sparse document —
        every field is optional and an omitted key falls back to the validator
        default, so absent fields are omitted rather than nulled. Value
        constraints are enforced by the write-side validator.
      properties:
        curate:
          $ref: '#/components/schemas/CurateManifest'
        optimize:
          $ref: '#/components/schemas/OptimizeManifest'
    ContextKind:
      type: string
      x-enum:
        - search
        - work
      default: search
      description: >-
        `search` — built from source documents; must be curated before it can be
        queried. `work` — built from traces of work done; queryable immediately
        and consolidated by `groom` rather than `curate`.
    ManifestSuggestion:
      type: object
      required:
        - matches
        - none
        - explored_at
      description: Outcome of a Design-flow explore run, pinned to the context row.
      properties:
        matches:
          type: array
          items:
            $ref: '#/components/schemas/TemplateMatch'
        none:
          type: boolean
          description: True when no template fit
        explored_at:
          type: string
          format: date-time
        task_id:
          type: string
    ContextStats:
      type: object
      required:
        - tasks_total
        - tasks_active
        - tasks_completed
        - tasks_failed
        - tasks_cancelled
        - tokens_total
        - runtime_seconds
      properties:
        tasks_total:
          type: integer
          format: int64
        tasks_active:
          type: integer
          format: int64
        tasks_completed:
          type: integer
          format: int64
        tasks_failed:
          type: integer
          format: int64
        tasks_cancelled:
          type: integer
          format: int64
        tokens_total:
          type: integer
          format: int64
        runtime_seconds:
          type: integer
          format: int64
    CurateManifest:
      type: object
      properties:
        chunks:
          $ref: '#/components/schemas/ChunksConfig'
        artifacts:
          $ref: '#/components/schemas/ArtifactsConfig'
    OptimizeManifest:
      type: object
      description: Scheduled self-tuning config.
      properties:
        schedule:
          type: string
          maxLength: 128
          default: 0 * * * *
          description: cron
        latency_threshold_ms:
          type: integer
          minimum: 0
          maximum: 600000
          default: 60000
        min_group_size:
          type: integer
          minimum: 1
          maximum: 100
          default: 2
        eval_pass_rate_threshold:
          type: number
          format: double
          minimum: 0
          maximum: 1
          default: 1
        max_iterations:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
    TemplateMatch:
      type: object
      required:
        - template_id
        - rationale
        - confidence
      properties:
        template_id:
          type: string
        rationale:
          type: string
        confidence:
          type: number
          format: double
    ChunksConfig:
      type: object
      description: Source chunking + embedding config.
      properties:
        enabled:
          type: boolean
          default: true
        embedding_model:
          type: string
          maxLength: 128
          default: multilingual-e5-large
        chunking:
          $ref: '#/components/schemas/ChunkingConfig'
        keyword:
          type: object
          properties:
            enabled:
              type: boolean
              default: true
    ArtifactsConfig:
      type: object
      description: Knowledge-artifact extraction config.
      properties:
        enabled:
          type: boolean
          default: false
        artifact_model:
          type: string
          x-enum:
            - standard
            - lite
          default: lite
        artifact_types:
          type: array
          maxItems: 32
          items:
            $ref: '#/components/schemas/ArtifactType'
        edge_types:
          type: array
          maxItems: 32
          items:
            $ref: '#/components/schemas/EdgeType'
        min_doc_count:
          type: integer
          minimum: 1
          maximum: 64
          default: 1
        max_tokens:
          type: integer
          minimum: 128
          maximum: 8192
          default: 1500
        max_doc_chars:
          type: integer
          minimum: 1000
          maximum: 2000000
          default: 60000
        extraction_window_chars:
          type: integer
          minimum: 0
          maximum: 1000000
          default: 0
        mention_max_chars:
          type: integer
          minimum: 100
          maximum: 4000
          default: 400
        max_mentions_per_artifact:
          type: integer
          minimum: 1
          maximum: 500
          default: 40
        mention_context_chars:
          type: integer
          minimum: 1000
          maximum: 100000
          default: 8000
        max_artifacts_per_type:
          type: integer
          minimum: 1
          maximum: 10000
          default: 10000
    ChunkingConfig:
      type: object
      properties:
        strategy:
          type: string
          x-enum:
            - markdown_heading
            - sliding_window
            - html
            - csv
            - code
          default: markdown_heading
        target_size:
          type: integer
          minimum: 64
          maximum: 4096
          default: 512
        overlap:
          type: integer
          minimum: 0
          maximum: 1024
          default: 64
        respect_sections:
          type: boolean
          default: true
    ArtifactType:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 64
        kind:
          type: string
          x-enum:
            - summary
            - topic
            - entity
            - event
            - doc
            - page
            - glossary
          default: topic
        scope:
          type: string
          x-enum:
            - document
            - corpus
          default: corpus
        icon:
          type: string
        description:
          type: string
        coverage:
          type: array
          maxItems: 32
          items:
            type: string
            maxLength: 128
        sections:
          type: array
          maxItems: 64
          items:
            type: string
            maxLength: 128
        min_doc_count:
          type: integer
          minimum: 1
          maximum: 64
          default: 1
        format:
          type: string
          x-enum:
            - markdown
            - sqlite
          default: markdown
        columns:
          type: array
          maxItems: 64
          description: sqlite-format artifacts only
          items:
            type: object
            required:
              - name
            properties:
              name:
                type: string
                maxLength: 64
              type:
                type: string
                x-enum:
                  - TEXT
                  - INTEGER
                  - REAL
                  - NUMERIC
                default: TEXT
              description:
                type: string
        natural_key:
          type: array
          maxItems: 16
          items:
            type: string
            maxLength: 64
    EdgeType:
      type: object
      required:
        - name
        - from
        - to
      properties:
        name:
          type: string
          maxLength: 64
        from:
          type: string
          maxLength: 64
          description: Source artifact-type name
        to:
          type: string
          maxLength: 64
          description: Target artifact-type name
        description:
          type: string
        attributes:
          type: array
          maxItems: 16
          items:
            type: string
            maxLength: 64
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Session token from POST /auth/login. Pass as `Authorization: Bearer
        <token>`. The alternative `X-Pinecone-Api-Key` header is also accepted
        for direct-key auth (used by the Nexus CLI on first contact).
    apiKey:
      type: apiKey
      in: header
      name: X-Pinecone-Api-Key
      description: Pinecone API key, accepted as an alternative to the bearer JWT.

````