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

# Get a definition

> Fetch a single flow definition by id. Cross-tenant access returns 404.



## OpenAPI

````yaml /openapi.json get /definitions/{definition_id}
openapi: 3.1.0
info:
  title: GetDialed Flows API
  version: 0.1.0
servers:
  - url: https://api.getdialed.ai/flows
    description: Production
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /definitions/{definition_id}:
    get:
      tags:
        - definitions
      summary: Get a definition
      description: Fetch a single flow definition by id. Cross-tenant access returns 404.
      operationId: get_definition_definitions__definition_id__get
      parameters:
        - name: definition_id
          in: path
          required: true
          schema:
            type: string
            title: Definition Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefinitionResponse'
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              example:
                detail: Authentication required
        '404':
          description: >-
            No such definition for this organization (cross-tenant access also
            returns 404)
          content:
            application/json:
              example:
                detail: Definition not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded — retry after the Retry-After header
          headers:
            Retry-After:
              description: Seconds to wait before retrying
              schema:
                type: integer
          content:
            application/json:
              example:
                detail: 'Rate limit exceeded: 100 per 1 minute'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    DefinitionResponse:
      properties:
        id:
          type: string
          title: Id
        org_id:
          type: string
          title: Org Id
        name:
          type: string
          title: Name
        version:
          type: integer
          title: Version
        status:
          type: string
          title: Status
        inputs:
          items:
            $ref: '#/components/schemas/DefinitionInput'
          type: array
          title: Inputs
        variables:
          items:
            $ref: '#/components/schemas/DefinitionVariable'
          type: array
          title: Variables
        steps:
          items:
            $ref: '#/components/schemas/Step'
          type: array
          title: Steps
        webhooks:
          items: {}
          type: array
          title: Webhooks
      type: object
      required:
        - id
        - org_id
        - name
        - version
        - status
        - inputs
        - variables
        - steps
        - webhooks
      title: DefinitionResponse
      example:
        id: def_a1b2c3d4
        inputs: []
        name: Nightly Five9 report sync
        org_id: org_a1b2c3d4
        status: active
        steps: []
        variables: []
        version: 1
        webhooks: []
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DefinitionInput:
      properties:
        name:
          type: string
          title: Name
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - object
            - array
            - datetime
          title: Type
        required:
          type: boolean
          title: Required
          default: true
        description:
          type: string
          title: Description
          default: ''
      type: object
      required:
        - name
        - type
      title: DefinitionInput
    DefinitionVariable:
      properties:
        name:
          type: string
          title: Name
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - object
            - array
            - datetime
          title: Type
        value:
          title: Value
      type: object
      required:
        - name
        - type
        - value
      title: DefinitionVariable
    Step:
      properties:
        step_id:
          type: string
          title: Step Id
        name:
          type: string
          title: Name
          default: ''
        tasks:
          items:
            $ref: '#/components/schemas/Task'
          type: array
          title: Tasks
        exit_conditions:
          items:
            $ref: '#/components/schemas/ExitCondition'
          type: array
          title: Exit Conditions
      type: object
      required:
        - step_id
      title: Step
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    Task:
      properties:
        task_id:
          type: string
          title: Task Id
        task_name:
          type: string
          title: Task Name
        platform_id:
          type: string
          title: Platform Id
        service_id:
          type: string
          title: Service Id
        action_id:
          type: string
          title: Action Id
        action_version:
          type: string
          title: Action Version
          default: '1.0'
        connection_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Connection Id
        execution_type:
          type: string
          enum:
            - immediate
            - scheduled
            - windowed
            - signaled
          title: Execution Type
          default: immediate
        execution_config:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/DelayConfig'
                - $ref: '#/components/schemas/FixedConfig'
                - $ref: '#/components/schemas/CronConfig'
              discriminator:
                propertyName: schedule_type
                mapping:
                  cron:
                    $ref: '#/components/schemas/CronConfig'
                  delay:
                    $ref: '#/components/schemas/DelayConfig'
                  fixed:
                    $ref: '#/components/schemas/FixedConfig'
            - $ref: '#/components/schemas/WindowedConfig'
            - $ref: '#/components/schemas/SignaledConfig'
            - type: 'null'
          title: Execution Config
        delivery:
          type: string
          enum:
            - direct
            - batched
          title: Delivery
          default: direct
        batch_config:
          anyOf:
            - $ref: '#/components/schemas/BatchConfig'
            - type: 'null'
        parameters:
          additionalProperties: true
          type: object
          title: Parameters
        on_success:
          type: string
          enum:
            - continue
            - skip_step
            - abort_execution
          title: On Success
          default: continue
        on_failure:
          type: string
          enum:
            - abort_step
            - abort_execution
            - log_and_continue
            - retry
          title: On Failure
          default: abort_step
        template_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Template Id
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
      type: object
      required:
        - task_id
        - task_name
        - platform_id
        - service_id
        - action_id
      title: Task
    ExitCondition:
      properties:
        condition:
          type: string
          title: Condition
        action:
          type: string
          enum:
            - continue
            - abort_execution
            - trigger_definition
            - skip_next_step
          title: Action
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        definition_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Definition Id
        inputs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Inputs
      type: object
      required:
        - condition
        - action
      title: ExitCondition
    DelayConfig:
      properties:
        schedule_type:
          type: string
          const: delay
          title: Schedule Type
          default: delay
        delay:
          type: string
          title: Delay
      type: object
      required:
        - delay
      title: DelayConfig
    FixedConfig:
      properties:
        schedule_type:
          type: string
          const: fixed
          title: Schedule Type
          default: fixed
        run_at:
          type: string
          format: date-time
          title: Run At
      type: object
      required:
        - run_at
      title: FixedConfig
    CronConfig:
      properties:
        schedule_type:
          type: string
          const: cron
          title: Schedule Type
          default: cron
        cron:
          type: string
          title: Cron
      type: object
      required:
        - cron
      title: CronConfig
    WindowedConfig:
      properties:
        timezone:
          type: string
          title: Timezone
        window:
          $ref: '#/components/schemas/TimeWindow'
        outside_window:
          type: string
          enum:
            - schedule_next
            - skip
          title: Outside Window
          default: schedule_next
      type: object
      required:
        - timezone
        - window
      title: WindowedConfig
    SignaledConfig:
      properties:
        signal_type:
          type: string
          enum:
            - webhook
            - polling
          title: Signal Type
          default: webhook
        timeout:
          type: string
          title: Timeout
        on_timeout:
          type: string
          enum:
            - continue
            - abort_step
            - abort_execution
          title: On Timeout
          default: continue
        on_timeout_output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: On Timeout Output
      type: object
      required:
        - timeout
      title: SignaledConfig
    BatchConfig:
      properties:
        batch_group_key:
          type: string
          title: Batch Group Key
        flush_strategy:
          type: string
          enum:
            - threshold_or_interval
            - threshold_only
            - interval_only
          title: Flush Strategy
          default: threshold_or_interval
        max_batch_size:
          type: integer
          title: Max Batch Size
          default: 1000
        flush_interval:
          type: string
          title: Flush Interval
          default: 60s
        min_batch_size:
          type: integer
          title: Min Batch Size
          default: 1
        priority:
          type: string
          enum:
            - normal
            - high
          title: Priority
          default: normal
        on_batch_failure:
          type: string
          enum:
            - retry_batch
            - abort_batch
          title: On Batch Failure
          default: retry_batch
        on_record_failure:
          type: string
          enum:
            - signal_failed
            - signal_and_retry
          title: On Record Failure
          default: signal_failed
      type: object
      required:
        - batch_group_key
      title: BatchConfig
    TimeWindow:
      properties:
        days:
          items:
            type: string
          type: array
          title: Days
        start_time:
          type: string
          title: Start Time
        end_time:
          type: string
          title: End Time
      type: object
      required:
        - days
        - start_time
        - end_time
      title: TimeWindow
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````