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

# Async REST endpoint callback (internal)

> Internal callback, not a client API. When a pipeline's REST preprocessor or REST destination is configured with `async: true`, Datris POSTs the payload to that endpoint (carrying `pipelineToken`, `pipelineName` and `data`) and then blocks the run until the endpoint calls back here with the same `pipelineToken`. The callback body is handed to the waiting run verbatim: for a preprocessor it is parsed like a synchronous response (`data.header` / `data.rows`, or `{"error": ...}` to fail the run); for a destination only an `error` field is inspected. A callback whose token has no waiting run is accepted and discarded. The run fails with a timeout if no callback arrives within the endpoint's `timeoutMs`.



## OpenAPI

````yaml /openapi.yaml post /api/v1/restendpoint/callback
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.57.1
  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/restendpoint/callback:
    post:
      tags:
        - Internal callbacks
      summary: Async REST endpoint callback (internal)
      description: >-
        Internal callback, not a client API. When a pipeline's REST preprocessor
        or REST destination is configured with `async: true`, Datris POSTs the
        payload to that endpoint (carrying `pipelineToken`, `pipelineName` and
        `data`) and then blocks the run until the endpoint calls back here with
        the same `pipelineToken`. The callback body is handed to the waiting run
        verbatim: for a preprocessor it is parsed like a synchronous response
        (`data.header` / `data.rows`, or `{"error": ...}` to fail the run); for
        a destination only an `error` field is inspected. A callback whose token
        has no waiting run is accepted and discarded. The run fails with a
        timeout if no callback arrives within the endpoint's `timeoutMs`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - pipelineToken
                - pipelineName
              properties:
                pipelineToken:
                  type: string
                  description: >-
                    The token Datris sent in the outbound request; identifies
                    the waiting run
                pipelineName:
                  type: string
                  description: The pipeline name Datris sent in the outbound request
                data:
                  type: object
                  description: >-
                    Preprocessor role — the processed payload, same shape as the
                    outbound `data`
                  properties:
                    header:
                      type: array
                      items:
                        type: string
                    rows:
                      type: array
                      items:
                        type: string
                error:
                  type: string
                  description: >-
                    Report a failure instead of data; the run stops with this
                    message
      responses:
        '200':
          description: Accepted (`OK`, text/plain)
          content:
            text/plain:
              schema:
                type: string
                example: OK
        '400':
          description: '`Missing pipelineToken` or `Missing pipelineName` (text/plain)'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Optional API key for authentication (enabled via application.yaml)

````

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