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

# Create or update a tap

> Creates a new tap or updates an existing tap with the same `name`.



## OpenAPI

````yaml /openapi.yaml post /api/v1/tap
openapi: 3.0.3
info:
  title: Datris API
  description: >
    REST API for the Datris AI Data Platform. Ingest, validate, transform,
    store, and retrieve data.


    For AI agent integration, use the [MCP
    Server](https://docs.datris.ai/mcp-server) instead.
  version: 1.0.0
  contact:
    name: Datris
    url: https://datris.ai
  license:
    name: Apache 2.0
servers:
  - url: http://localhost:8080
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/tap:
    post:
      tags:
        - Taps
      summary: Create or update a tap
      description: Creates a new tap or updates an existing tap with the same `name`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TapConfig'
      responses:
        '200':
          description: Saved tap configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TapConfig'
        '400':
          description: Validation error
components:
  schemas:
    TapConfig:
      type: object
      required:
        - name
        - description
        - targetPipeline
      properties:
        name:
          type: string
          description: Unique tap identifier
        description:
          type: string
          description: Plain-English instruction used to generate the script
        scriptPath:
          type: string
          description: MinIO path of the generated Python script
        targetPipeline:
          type: string
          description: Pipeline this tap feeds into (may be empty for unattached taps)
        packages:
          type: array
          items:
            type: string
          description: Extra pip packages required by the script
        secretName:
          type: string
          description: Name of the tap secret (Vault) injected as env vars at runtime
        cronExpression:
          type: string
          description: Quartz CRON expression for scheduled runs (omit for manual-only)
        enabled:
          type: boolean
          default: true
        tapType:
          type: string
          enum:
            - structured
            - document
          default: structured
          description: >-
            `structured` (default) — the script returns records that flow into a
            structured pipeline destination. `document` — the script returns
            `{uri, filename, content}` dicts destined for a vector-store
            pipeline (unstructured source +
            qdrant/pgvector/weaviate/milvus/chroma destination). The server
            rejects a document tap pointed at an incompatible pipeline with HTTP
            400. Document taps also use a per-URI ledger so each file is
            processed once across re-runs.
        lastRunStatus:
          type: string
          enum:
            - success
            - failure
        lastRunTime:
          type: string
        lastRunRecordCount:
          type: integer
        lastRunError:
          type: string
        lastRunDataType:
          type: string
          enum:
            - csv
            - json
            - xml
            - text
            - document
        lastRunColumns:
          type: array
          items:
            type: string
        lastTestRunStatus:
          type: string
        lastTestRunTime:
          type: string
        lastTestRunRecordCount:
          type: integer
        lastTestRunError:
          type: string
        lastTestRunDataType:
          type: string
        lastTestRunColumns:
          type: array
          items:
            type: string
        createdAt:
          type: string
        updatedAt:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Optional API key for authentication (enabled via application.yaml)

````