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

# Flows - Get flow definition

> Returns the full definition of a flow, including its dynamic inputs and cost.

**Inputs** define what values the caller must provide when running the flow:
- `creation` type: accepts an image/media URL, base64-encoded data, or an existing creation identifier
- `text` type: accepts a plain text string (prompt, label, etc.)
- `number` type: accepts a numeric value
- `select` type: accepts a value from predefined options

Use each input's `api_key` field (recommended, human-friendly node name) as the identifier when calling the run endpoint.
The UUID-based `id` field is still accepted for backward compatibility.
The `tool_metadata.total_cost` field indicates the credit cost per execution.




## OpenAPI

````yaml get /v1/ai/flows/{flow-id}
openapi: 3.0.0
info:
  description: >-
    The Magnific API is your gateway to a vast collection of high-quality
    digital resources for your applications and projects. As a leading platform,
    it offers a wide range of graphics, including vectors, photos,
    illustrations, icons, PSD templates, and more, all curated by talented
    designers from around the world.
  title: Magnific API
  version: 1.0.0
servers:
  - description: B2B API Production V1
    url: https://api.magnific.com
security:
  - magnificApiKey: []
paths:
  /v1/ai/flows/{flow-id}:
    get:
      tags:
        - flows
      summary: Flows - Get flow definition
      description: >
        Returns the full definition of a flow, including its dynamic inputs and
        cost.


        **Inputs** define what values the caller must provide when running the
        flow:

        - `creation` type: accepts an image/media URL, base64-encoded data, or
        an existing creation identifier

        - `text` type: accepts a plain text string (prompt, label, etc.)

        - `number` type: accepts a numeric value

        - `select` type: accepts a value from predefined options


        Use each input's `api_key` field (recommended, human-friendly node name)
        as the identifier when calling the run endpoint.

        The UUID-based `id` field is still accepted for backward compatibility.

        The `tool_metadata.total_cost` field indicates the credit cost per
        execution.
      operationId: get_flow
      parameters:
        - description: >-
            Short unique identifier (sqid) of the flow. Discover flow
            identifiers via GET /v1/ai/flows.
          in: path
          name: flow-id
          required: true
          schema:
            example: uqzQLDr2Aw
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                data:
                  sqid: uqzQLDr2Aw
                  name: Sketch to Realism
                  inputs:
                    - id: input-a1b2c3d4-e5f6-7890-abcd-ef1234567890-1
                      api_key: image
                      key: image
                      type: creation
                      label: Image
                      config:
                        mediaType: image
                      nodeId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                      default: null
                      required: true
                      presentation: null
                  tool_metadata:
                    icon: workflow
                    description_key: null
                    translation_key: null
                    category: general
                    sort_order: 999
                    total_cost: 5
              schema:
                $ref: '#/components/schemas/get_flow_200_response'
          description: OK - Flow definition with inputs and cost.
        '401':
          content:
            application/json:
              examples:
                invalid_api_key:
                  summary: API key is not valid
                  value:
                    message: Invalid API key
                missing_api_key:
                  summary: API key is not provided
                  value:
                    message: Missing API key
              schema:
                $ref: '#/components/schemas/get_all_style_transfer_tasks_400_response'
          description: >-
            Unauthorized - The client must authenticate itself to get the
            requested response.
        '404':
          description: Flow not found.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get_all_style_transfer_tasks_500_response'
          description: >-
            Internal Server Error - The server has encountered a situation it
            doesn't know how to handle.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get_all_style_transfer_tasks_503_response'
          description: Service Unavailable
components:
  schemas:
    get_flow_200_response:
      example:
        data:
          inputs:
            - id: input-4050c3f3-8a26-4953-97a8-cb97bceb4816-1
              api_key: text_prompt
              key: text_prompt
              type: text
              label: 'Text #1'
              config: null
              nodeId: 4050c3f3-8a26-4953-97a8-cb97bceb4816
              default: null
              required: true
              presentation:
                mode: textarea
                type: text
            - id: input-4050c3f3-8a26-4953-97a8-cb97bceb4816-1
              api_key: text_prompt
              key: text_prompt
              type: text
              label: 'Text #1'
              config: null
              nodeId: 4050c3f3-8a26-4953-97a8-cb97bceb4816
              default: null
              required: true
              presentation:
                mode: textarea
                type: text
          name: Sketch to Realism
          tool_metadata:
            total_cost: 5
            icon: workflow
            translation_key: translation_key
            description_key: description_key
            category: general
            sort_order: 999
          sqid: uqzQLDr2Aw
      properties:
        data:
          $ref: '#/components/schemas/flow-detail'
      required:
        - data
      type: object
    get_all_style_transfer_tasks_400_response:
      example:
        message: message
      properties:
        message:
          type: string
      type: object
    get_all_style_transfer_tasks_500_response:
      example:
        message: Internal Server Error
      properties:
        message:
          example: Internal Server Error
          type: string
      type: object
    get_all_style_transfer_tasks_503_response:
      example:
        message: Service Unavailable. Please try again later.
      properties:
        message:
          example: Service Unavailable. Please try again later.
          type: string
      type: object
    flow-detail:
      description: Full definition of a flow including dynamic inputs and cost.
      example:
        inputs:
          - id: input-4050c3f3-8a26-4953-97a8-cb97bceb4816-1
            api_key: text_prompt
            key: text_prompt
            type: text
            label: 'Text #1'
            config: null
            nodeId: 4050c3f3-8a26-4953-97a8-cb97bceb4816
            default: null
            required: true
            presentation:
              mode: textarea
              type: text
          - id: input-4050c3f3-8a26-4953-97a8-cb97bceb4816-1
            api_key: text_prompt
            key: text_prompt
            type: text
            label: 'Text #1'
            config: null
            nodeId: 4050c3f3-8a26-4953-97a8-cb97bceb4816
            default: null
            required: true
            presentation:
              mode: textarea
              type: text
        name: Sketch to Realism
        tool_metadata:
          total_cost: 5
          icon: workflow
          translation_key: translation_key
          description_key: description_key
          category: general
          sort_order: 999
        sqid: uqzQLDr2Aw
      properties:
        sqid:
          description: Short unique identifier.
          example: uqzQLDr2Aw
          type: string
        name:
          description: Human-readable name set by the creator.
          example: Sketch to Realism
          type: string
        inputs:
          description: |
            Dynamic input definitions. Each input corresponds to an entry node
            in the flow. The caller must provide values for all `required`
            inputs when calling the run endpoint.
          items:
            $ref: '#/components/schemas/input-definition'
          type: array
        tool_metadata:
          $ref: '#/components/schemas/tool-metadata'
      required:
        - inputs
        - name
        - sqid
      type: object
    input-definition:
      description: >
        Defines a single input parameter for the flow.

        Use the `api_key` field (recommended) or the `id` field (legacy) as the
        identifier in the `inputs` object when calling the run endpoint.
      example:
        id: input-4050c3f3-8a26-4953-97a8-cb97bceb4816-1
        api_key: text_prompt
        key: text_prompt
        type: text
        label: 'Text #1'
        config: null
        nodeId: 4050c3f3-8a26-4953-97a8-cb97bceb4816
        default: null
        required: true
        presentation:
          mode: textarea
          type: text
      properties:
        id:
          description: >
            UUID-based identifier for this input. Format: `input-{nodeId}-{n}`.

            Still accepted as a key in the `inputs` object for backward
            compatibility; prefer `api_key`.
          example: input-4050c3f3-8a26-4953-97a8-cb97bceb4816-1
          type: string
        api_key:
          description: >
            Human-friendly identifier for this input, matching the node name.

            Recommended identifier to use as the key in the `inputs` object when
            running the flow.
          example: text_prompt
          type: string
        key:
          deprecated: true
          description: >
            (Deprecated) Legacy human-readable key. Superseded by `api_key`; may
            be absent in newer responses. Prefer `api_key`.
          example: text_prompt
          type: string
        type:
          description: >
            The type of input value expected:

            - `creation`: Image or media file (accepts URL, base64, or creation
            sqid)

            - `text`: Text prompt or string

            - `number`: Numeric value

            - `select`: Choice from predefined options
          enum:
            - creation
            - text
            - number
            - select
          example: text
          type: string
        label:
          description: Human-readable label for display.
          example: 'Text #1'
          type: string
        config:
          $ref: '#/components/schemas/input_definition_config'
        nodeId:
          description: UUID of the flow node this input feeds into.
          example: 4050c3f3-8a26-4953-97a8-cb97bceb4816
          format: uuid
          type: string
        default:
          description: Default value if not provided by the caller. Null means no default.
          nullable: true
        required:
          description: Whether this input must be provided when running the flow.
          example: true
          type: boolean
        presentation:
          $ref: '#/components/schemas/input_definition_presentation'
      required:
        - id
        - key
        - required
        - type
      type: object
    tool-metadata:
      description: Metadata about the tool (UI hints, cost, categorization).
      example:
        total_cost: 5
        icon: workflow
        translation_key: translation_key
        description_key: description_key
        category: general
        sort_order: 999
      properties:
        icon:
          description: Icon identifier for UI rendering.
          example: workflow
          type: string
        description_key:
          description: Translation key for the tool description.
          nullable: true
          type: string
        translation_key:
          description: Translation key for the tool name.
          nullable: true
          type: string
        category:
          description: Category for grouping tools.
          example: general
          type: string
        sort_order:
          description: Display order within category.
          example: 999
          type: integer
        total_cost:
          description: Total credit cost per execution (sum of all workflow nodes).
          example: 5
          type: integer
      type: object
    input_definition_config:
      description: |
        Type-specific configuration.
        For `creation` type: contains `mediaType` (image, video, audio).
        For `select` type: may contain `options`.
        Null when not applicable (e.g. for `text` type).
      nullable: true
      properties:
        mediaType:
          description: For `creation` type — the expected media kind.
          enum:
            - image
            - video
            - audio
          example: image
          type: string
      type: object
    input_definition_presentation:
      description: |
        UI presentation hints for rendering the input.
        Present for `text` type inputs; null or absent for other types.
      nullable: true
      properties:
        mode:
          description: The UI control mode (e.g. `textarea`, `input`).
          example: textarea
          type: string
        type:
          description: The presentation type.
          example: text
          type: string
      type: object
  securitySchemes:
    magnificApiKey:
      description: >
        Your Magnific API key. Required for authentication. [Learn how to obtain
        an API key](https://docs.magnific.com/quickstart)
      in: header
      name: x-magnific-api-key
      type: apiKey

````