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

> API endpoint to trigger the execution of a playbook in Blink.

# Execute a playbook



## OpenAPI

````yaml post /workspace/{ws_id}/playbooks/{id}/execute
openapi: 3.0.1
info:
  title: Blink REST API
  description: >-
    The Blink REST API provides programmatic access to Blink data and
    functionality, enabling the management of resources such as workflows,
    users, cases, and more.
  termsOfService: https://www.blinkops.com/terms-of-use
  contact:
    name: API Support
    url: http://blinkops.com/support
    email: support@blinkops.com
  version: '1.0'
servers:
  - url: https://app.blinkops.com/api/v1
security: []
tags:
  - name: Controller
    description: Controller health and stats
  - name: Connections
    description: Manage your connections
  - name: Integrations
    description: Manage your integrations
  - name: Invites
    description: Manage your invites
  - name: Workflows
    description: Create and execute your workflows
  - name: Executions
    description: Get information and manage executions
  - name: Runners
    description: Configure your runners
  - name: Tables
    description: Manage your tables
  - name: Case Management
    description: Manage your cases
  - name: User Settings
    description: Manage user settings
  - name: Webhook
    description: Send to webhook
  - name: workspaces
    description: Manage your workspaces
  - name: User Info
    description: Get Information on current user
  - name: Portal
    description: Manage your portal apps
  - name: Groups
    description: Manage your Groups
  - name: Users
    description: Manage your users
paths:
  /workspace/{ws_id}/playbooks/{id}/execute:
    post:
      tags:
        - Workflows
      summary: Execute a playbook
      description: >-
        Starts execution of the specified playbook.

        By default, the execution runs asynchronously and returns the execution
        ID immediately.

        Use the `run_sync` parameter to wait for the execution to complete and
        return the output directly.

        **Note**: When running synchronously, the request will block until the
        playbook completes or times out.
      operationId: ExecutePlaybook
      parameters:
        - name: id
          in: path
          description: The ID of the playbook to execute
          required: true
          schema:
            type: string
        - name: ws_id
          in: path
          description: The ID of the workspace containing the playbook
          required: true
          schema:
            type: string
        - name: run_sync
          in: query
          description: >-
            When set to true, runs the playbook synchronously and returns the
            execution output instead of the execution ID. The request blocks
            until the workflow completes or times out
          schema:
            type: boolean
        - name: timeout
          in: query
          description: >-
            The number of seconds to wait for completion when running
            synchronously. Only applicable when `run_sync` is true
          schema:
            type: integer
      requestBody:
        description: >-
          Playbook execution parameters including input values, event data,
          runner selection, and callback configuration
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/playbook_inputs.PlaybookInputParamValues'
        required: false
      responses:
        '200':
          description: >-
            Execution ID when running asynchronously, or playbook output when
            running synchronously
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.DocsExecuteWorkflowOutput'
        '400':
          description: Invalid request parameters or input validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_responses.ErrorWrapper'
        '404':
          description: Playbook not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_responses.ErrorWrapper'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    playbook_inputs.PlaybookInputParamValues:
      type: object
      properties:
        callback:
          $ref: '#/components/schemas/playbook_inputs.WorkflowCallback'
        event:
          type: object
          additionalProperties:
            type: object
          description: The data that is used on an event-based workflow
        input_values:
          type: object
          additionalProperties: true
          description: Input parameters that will be used by the workflow
        past_exec_ref:
          type: string
          description: The ID of a previous execution, used when rerunning
        runner:
          type: string
          description: The runner group that will run the workflow
        trigger_type:
          type: string
          description: The type of the trigger of the workflow
    api.DocsExecuteWorkflowOutput:
      type: object
      properties:
        execution_id:
          type: string
          description: The ID of the created execution
          example: a22f642a-f4fc-4c66-b978-6f1d1008e6ae
    api_responses.ErrorWrapper:
      type: object
      properties:
        data:
          type: object
        details:
          type: string
        identifier:
          type: string
        message:
          type: string
        status:
          type: integer
          example: 404
        user_error:
          type: object
    playbook_inputs.WorkflowCallback:
      type: object
      properties:
        body:
          type: object
        cookies:
          type: object
        disableSSL:
          type: boolean
        excludeDefaultMetadata:
          type: boolean
        headers:
          type: object
        method:
          type: string
        url:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: >-
        Use your API key to access BlinkOps API. To generate an API key, please
        log in to your BlinkOps account and navigate to the API Keys section in
        the user settings page. Add the generated key to your request headers as
        BLINK-API-KEY.
      name: BLINK-API-KEY
      in: header

````