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

# Issue one grant per recipient under a single scope. Atomic across the batch.



## OpenAPI

````yaml /openapi/customer-api.json post /shared-grants/share-view
openapi: 3.0.0
info:
  contact: {}
  description: >-
    Flow customer API reference. Start with the [quickstart](/api/quickstart)
    and [authentication guide](/api/authentication).
  title: Customer API
  version: 1.0.0
servers:
  - description: Flow API
    url: https://backend.branch.flowengineering.com
security: []
tags:
  - name: Automations
  - name: Branches
  - name: Comments
  - name: Convert
  - name: Data Model
  - name: Diagrams
  - name: Entities
  - name: Files
  - name: Import
  - name: Notifications
  - name: Projects
  - name: ReqIF
  - name: ReqIF Import
  - name: Shared Access Grants
  - name: User Groups
  - name: Users
paths:
  /shared-grants/share-view:
    post:
      tags:
        - Shared Access Grants
      summary: >-
        Issue one grant per recipient under a single scope. Atomic across the
        batch.
      operationId: SharedGrantsController_shareView
      parameters:
        - description: Workspace identifier
          in: header
          name: customer
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShareViewBatchDto'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareViewBatchResponseDto'
          description: ''
      security:
        - api-key: []
        - bearer: []
components:
  schemas:
    ShareViewBatchDto:
      properties:
        access_level:
          allOf:
            - $ref: '#/components/schemas/SharedAccessLevel'
          default: viewer
          description: >-
            Capability granted for this scope. Viewer preserves v1 read-only
            sharing.
        branch_id:
          description: Branch the grant unlocks. Use "master" for the base branch.
          type: string
        branch_scope:
          allOf:
            - $ref: '#/components/schemas/SharedBranchScope'
          default: branch
          description: >-
            How far the grants reach from branch_id: that branch alone, it plus
            every branch descended from it, or every branch in the project.
        expires_at:
          description: ISO8601 expiry. Omit for permanent grants.
          nullable: true
          type: string
        project_id:
          description: Project the grant is scoped to
          type: string
        recipients:
          description: >-
            Recipients of the grant. Each entry is an existing user_id, an
            existing user_group_id, or an email; emails for unknown users
            trigger an external-role invite.
          items:
            $ref: '#/components/schemas/ShareViewRecipientDto'
          type: array
        starting_entity_id:
          description: Entity the view should anchor to for the recipient
          type: string
        suppress_notification:
          default: false
          type: boolean
        view_id:
          description: CustomView.id from the project-scoped custom-views-2 registry
          type: string
      required:
        - recipients
        - project_id
        - branch_id
        - view_id
        - starting_entity_id
      type: object
    ShareViewBatchResponseDto:
      properties:
        grants:
          description: Grants created — one per unique recipient.
          items:
            $ref: '#/components/schemas/SharedAccessGrantResponseDto'
          type: array
        invited_user_ids:
          description: >-
            Subset of recipient user ids whose User row was created by this call
            (i.e. the email was previously unknown).
          items:
            type: string
          type: array
      required:
        - grants
        - invited_user_ids
      type: object
    SharedAccessLevel:
      enum:
        - viewer
        - writer
      type: string
    SharedBranchScope:
      enum:
        - branch
        - branch_and_children
        - all_branches
      type: string
    ShareViewRecipientDto:
      properties:
        email:
          description: >-
            Recipient email. Existing users are looked up; unknown emails are
            invited as Role.external in the same transaction. Mutually exclusive
            with user_id.
          type: string
        user_group_id:
          description: >-
            Existing workspace user group receiving the grant. Mutually
            exclusive with user_id and email.
          type: string
        user_id:
          description: >-
            Existing workspace user receiving the grant. Mutually exclusive with
            email.
          type: string
      type: object
    SharedAccessGrantResponseDto:
      properties:
        access_level:
          allOf:
            - $ref: '#/components/schemas/SharedAccessLevel'
        branch_id:
          type: string
        branch_scope:
          allOf:
            - $ref: '#/components/schemas/SharedBranchScope'
        created_at:
          type: string
        created_by_id:
          nullable: true
          type: string
        expires_at:
          nullable: true
          type: string
        first_viewed_at:
          nullable: true
          type: string
        id:
          type: string
        preparing:
          type: boolean
        project_id:
          type: string
        recipient_type:
          allOf:
            - $ref: '#/components/schemas/SharedAccessGrantRecipientType'
        starting_entity_id:
          type: string
        user_email:
          nullable: true
          type: string
        user_group_id:
          nullable: true
          type: string
        user_group_name:
          nullable: true
          type: string
        user_id:
          nullable: true
          type: string
        view_id:
          type: string
      required:
        - id
        - recipient_type
        - user_id
        - user_email
        - user_group_id
        - user_group_name
        - project_id
        - branch_id
        - view_id
        - starting_entity_id
        - access_level
        - branch_scope
        - expires_at
        - created_at
        - created_by_id
        - first_viewed_at
        - preparing
      type: object
    SharedAccessGrantRecipientType:
      enum:
        - user
        - user_group
      type: string
  securitySchemes:
    api-key:
      in: header
      name: X-API-Key
      type: apiKey
    bearer:
      bearerFormat: JWT
      scheme: bearer
      type: http

````