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

# Run a flow

> Start a flow execution and return a `task_id`. Poll `GET /v1/tasks/{task_id}` to check status and retrieve outputs. Inputs are passed as `{input_id: value}` — use `GET /v1/flows/{flow_id}` to discover the declared inputs.

<Warning>
  This endpoint is **asynchronous**. It returns a `task_id` — poll [Get task status](/api-reference/endpoint/tasks-get-status) to retrieve your results. Task data expires after **24 hours**.
</Warning>


## OpenAPI

````yaml POST /v1/flows/{flow_id}/run
openapi: 3.1.0
info:
  title: Databar.ai API
  description: >-

    # Authentication


    Databar uses API keys to allow access to the API. You can find your API key
    in your workspace home page, but to use the REST API you’ll first need to
    schedule a call with us.

    Our API expects the API key to be included in all API requests to the server
    in the Header of your request with the key `x-apikey`.

    To find your API key, head over to your Databar workspace and click
    Integrations.


    **Example:**


    `bash

    curl https://api.databar.ai/v1/user/me -H x-apikey: {YOUR_API_KEY}`
  contact:
    email: info@databar.ai
  version: 0.1.2
servers:
  - url: https://api.databar.ai
    description: Production
security: []
paths:
  /v1/flows/{flow_id}/run:
    post:
      tags:
        - Flows
      summary: Run a flow
      description: >-
        Start a flow execution and return a `task_id`. Poll `GET
        /v1/tasks/{task_id}` to check status and retrieve outputs. Inputs are
        passed as `{input_id: value}` — use `GET /v1/flows/{flow_id}` to
        discover the declared inputs.
      operationId: run_flow_v1_flows__flow_id__run_post
      parameters:
        - name: flow_id
          in: path
          required: true
          schema:
            type: integer
            title: Flow ID
          description: Numeric ID of the flow to run
        - name: x-apikey
          in: header
          required: true
          schema:
            type: string
            title: API Key
            description: API Key for authentication
          description: API Key for authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunFlowIn'
            example:
              inputs:
                domain: stripe.com
      responses:
        '200':
          description: Task created — poll GET /v1/tasks/{task_id} for results
          content:
            application/json:
              schema:
                $ref: 63bcfd37-0519-4b79-a66d-23a35bbfcfef
              example:
                task_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                status: processing
        '403':
          description: Forbidden
        '404':
          description: Flow not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RunFlowIn:
      properties:
        inputs:
          type: object
          additionalProperties:
            type: string
          title: Inputs
          description: >-
            Maps flow input id → value string. Use `GET /v1/flows/{flow_id}` to
            discover the required input ids.
          default: {}
      type: object
      title: RunFlowIn
    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

````