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

# Start workflow by slug

> Initiates a workflow run based on its slug. Accepts JSON or multipart/form-data for input.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/samplehc/openapi.documented.yml post /api/v2/workflows/{workflowSlug}/start
openapi: 3.0.3
info:
  title: Sample Healthcare API
  description: API for Sample Healthcare
  version: 1.0.0
servers: []
security: []
paths:
  /api/v2/workflows/{workflowSlug}/start:
    post:
      tags:
        - Workflow
      summary: Start workflow by slug
      description: >-
        Initiates a workflow run based on its slug. Accepts JSON or
        multipart/form-data for input.
      parameters:
        - schema:
            type: string
          in: path
          name: workflowSlug
          required: true
          description: The slug of the workflow definition to start.
        - schema:
            type: string
            enum:
              - standard
              - top-level
          in: header
          name: X-Sample-Start-Data-Parse-Method
          required: false
          description: >-
            Controls how the request body is parsed for start data. 'standard'
            (default): expects start data nested under a 'startData' key, e.g. {
            "startData": { "foo": "bar" } }. 'top-level': treats the entire
            request body as start data, e.g. { "foo": "bar" }. This header is
            experimental and may change in the future.
      requestBody:
        content:
          application/json:
            schema:
              description: >-
                The workflow input data. Format depends on
                X-Sample-Start-Data-Parse-Method header: If 'standard'
                (default), wrap your data in a 'startData' key: { "startData": {
                ... } }. If 'top-level', provide your data directly at the root
                level: { ... }. For multipart/form-data requests, include fields
                and files directly in the form data.
        description: >-
          The workflow input data. Format depends on
          X-Sample-Start-Data-Parse-Method header: If 'standard' (default), wrap
          your data in a 'startData' key: { "startData": { ... } }. If
          'top-level', provide your data directly at the root level: { ... }.
          For multipart/form-data requests, include fields and files directly in
          the form data.
      responses:
        '200':
          description: Workflow initiated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  workflowRunId:
                    type: string
                    description: >-
                      The ID of the newly started workflow run. This can be used
                      to check its status or cancel the run.
                  nextTaskId:
                    type: string
                    nullable: true
                    description: >-
                      The ID of the first task in the workflow run, or null if
                      the workflow completes synchronously or has no starting
                      task.
                required:
                  - workflowRunId
                  - nextTaskId
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: The error message.
                  message:
                    type: string
                    description: The message.
                  statusCode:
                    type: number
                    description: The status code.
                  details:
                    type: object
                    additionalProperties: {}
                    description: The details of the error
                additionalProperties: true
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Workflow with the specified slug not found.
                required:
                  - error
                additionalProperties: false

````