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

# Get a workflow's contract

> Read a workflow's inputs, output shape, track record and endpoints by slug.



## OpenAPI

````yaml GET /v1/workflows/{slug}
openapi: 3.0.3
info:
  title: Valendata REST API
  version: 1.0.0
  description: >-
    Trigger Skills, manage Workflows, retrieve Runs, and stream structured
    results from any language using JSON over HTTPS.
servers:
  - url: https://api.valendata.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Skills
    description: Execute and inspect published Skills.
  - name: Workflows
    description: Trigger multi-step Workflows and list them.
  - name: Runs
    description: Start async Skill runs and read Skill and Workflow run results.
  - name: Skill creation
    description: Create a Skill from a plain-language task.
  - name: Skill improvement
    description: >-
      Fix a Skill, add fields to it or re-learn its detail steps, poll the
      result, and read its change history.
  - name: Versions
    description: List, diff, restore, and pin a Skill's recipe versions.
  - name: Webhooks
    description: Signed delivery of finished async runs.
paths:
  /v1/workflows/{slug}:
    get:
      tags:
        - Workflows
      summary: Get a Workflow's API contract
      description: >-
        What the workflow takes (its API trigger's inputs, as a list and as JSON
        Schema), what a run returns, its track record over the last 20 finished
        runs, and the endpoints to call. Works with an API key
        (`workflows:read`) or a signed-in session.
      operationId: getWorkflowApi
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
          description: The workflow's slug (shown on its API tab).
          example: test-workflow-api
      responses:
        '200':
          description: The workflow's contract.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowApiInfo'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - ApiKeyAuth: []
        - SessionAuth: []
components:
  schemas:
    WorkflowApiInfo:
      type: object
      properties:
        id:
          type: string
        slug:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        status:
          type: string
        input_schema:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowInput'
        input_json_schema:
          type: object
          description: JSON Schema (draft 2020-12) of `inputs`.
        output:
          type: string
          description: What `outputs` holds, in one sentence.
        output_json_schema:
          type: object
        run_json_schema:
          type: object
        trigger:
          type: object
          description: 'The API trigger node: `{type: "api_trigger", node}`.'
        reliability:
          type: object
          properties:
            success_rate:
              type: number
              description: 0–1 over the last 20 finished runs.
              nullable: true
            runs:
              type: integer
            label:
              type: string
            typical_seconds:
              type: number
              nullable: true
            last_success_at:
              type: string
              nullable: true
            total_runs:
              type: integer
        api_endpoint:
          type: string
          example: /v1/workflows/test-workflow-api/run
        runs_endpoint:
          type: string
        run_status_endpoint:
          type: string
        mcp_tool:
          type: string
          example: workflow_test-workflow-api
    WorkflowInput:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          example: limit
        type:
          type: string
          enum:
            - string
            - number
            - integer
            - boolean
            - array
            - object
        required:
          type: boolean
        default: {}
        description:
          type: string
          nullable: true
        example: {}
    Error:
      type: object
      properties:
        detail:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          description: >-
            Error message. Usually a plain string; may be a structured object
            for some errors.
      example:
        detail: Invalid or expired API key
  responses:
    Unauthorized:
      description: >-
        Unauthorized. The Authorization header is missing, malformed, or the
        credential is invalid or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        Forbidden. You may not run or change this Skill, or it is not published
        or active.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found in your Workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: vd_sk_...
      description: >-
        API key with the `vd_sk_` prefix. Create keys from Settings, API Keys in
        the dashboard.
    SessionAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Session token (JWT) obtained by calling `POST /api/auth/login` with your
        email and password.

````

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