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

# Share Workflow

> Shares a workflow with other users. This action is owner-only. The call upserts the sharing group with the given access level and recipient list. The workflow's referenced agent and sub-workflow IDs are flattened and forwarded so access can be mirrored to them.



## OpenAPI

````yaml openapi/superflow.yaml POST /workflows/{id}/share
openapi: 3.0.3
info:
  title: Lyzr SuperFlow API
  version: '1.0'
  description: >-
    SuperFlow orchestration API covering workflow CRUD, the execution lifecycle
    (run, pause, resume, terminate, rerun), scheduling, and human-in-the-loop
    approvals. Chat-completions and agent CRUD endpoints are documented
    separately and are not part of this surface.
servers:
  - url: https://inference.studio.lyzr.ai/api
security:
  - ApiKeyAuth: []
tags:
  - name: workflows
    description: Create, read, update, delete, and share workflow definitions.
  - name: workflow-execution
    description: Run workflows and control the execution lifecycle.
  - name: workflow-schedules
    description: Cron-driven recurring triggers for stored workflows.
  - name: approvals
    description: Human-in-the-loop approval requests raised by running workflows.
paths:
  /workflows/{id}/share:
    post:
      tags:
        - workflows
      summary: Share a workflow
      description: >-
        Shares a workflow with other users. This action is owner-only. The call
        upserts the sharing group with the given access level and recipient
        list. The workflow's referenced agent and sub-workflow IDs are flattened
        and forwarded so access can be mirrored to them.
      operationId: shareWorkflow
      parameters:
        - name: id
          in: path
          required: true
          description: Workflow ID
          schema:
            type: string
      requestBody:
        required: true
        description: Share payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShareRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Sharing service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Sharing not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ShareRequest:
      type: object
      properties:
        access_level:
          $ref: '#/components/schemas/AccessLevel'
        shared_with:
          type: array
          items:
            $ref: '#/components/schemas/SharedUser'
    GroupResponse:
      type: object
      properties:
        _id:
          type: string
        group_id:
          type: string
        root_resource_id:
          type: string
        root_resource_type:
          type: string
        access_level:
          $ref: '#/components/schemas/AccessLevel'
        shared_with:
          type: array
          items:
            $ref: '#/components/schemas/SharedUser'
        agent_ids:
          type: array
          items:
            type: string
        superflow_ids:
          type: array
          items:
            type: string
        user_id:
          type: string
        user_email:
          type: string
        org_id:
          type: string
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
    AccessLevel:
      type: string
      enum:
        - private
        - organisation
        - public
        - read
        - write
        - execute
    SharedUser:
      type: object
      properties:
        email:
          type: string
        user_id:
          type: string
        access_level:
          $ref: '#/components/schemas/AccessLevel'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Tenant API key. Required on every endpoint.

````