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

# Share Agent (Bulk Permissions)

> Grants one or more users access to a Custom Agent in a single atomic operation. Supports VIEWER, EDITOR, and CREATOR permission levels.



## OpenAPI

````yaml POST /noCo/api/v2/elementPermissions/bulk
openapi: 3.1.0
info:
  title: DataGOL Custom Agents API
  description: >-
    Complete API for creating, configuring, sharing, and interacting with Custom
    AI Agents on the DataGOL platform. Covers agent CRUD, permissions,
    conversations, and streaming.
  version: 1.0.0
  contact:
    name: DataGOL Support
    url: https://datagol.ai
servers:
  - url: https://be.datagol.ai
    description: Backend API (Production) — agent management, conversations, permissions
  - url: https://ai.datagol.ai
    description: AI Core (Production) — streaming, chat completion, conversation naming
security:
  - ServiceAccountAuth: []
  - BearerAuth: []
tags:
  - name: Custom Agents
    description: Create, read, and manage Custom AI Agents.
  - name: Permissions
    description: View and manage who has access to an agent.
  - name: Conversations
    description: Open and list conversation sessions backed by an agent.
  - name: Messaging
    description: Send messages and stream AI responses.
  - name: Reference Data
    description: >-
      Lookup APIs for workspaces, connectors, and team members used when
      building agent configs.
paths:
  /noCo/api/v2/elementPermissions/bulk:
    post:
      tags:
        - Permissions
      summary: Share Agent with Team Members
      description: >-
        Grants one or more users access to a Custom Agent in a single atomic
        operation. Supports VIEWER, EDITOR, and CREATOR permission levels.
      operationId: bulkShareAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkPermissionRequest'
            example:
              permissions:
                - elementId: 7bf5f4d6-743d-414f-aa4a-96f7a20ce0fd
                  elementType: CUSTOM_AGENT
                  userId: 935
                  permission: CREATOR
      responses:
        '200':
          description: Permissions applied successfully.
        '403':
          description: User lacks ASSIGN_ROLES permission.
components:
  schemas:
    BulkPermissionRequest:
      type: object
      required:
        - permissions
      properties:
        permissions:
          type: array
          items:
            type: object
            required:
              - elementId
              - elementType
              - userId
              - permission
            properties:
              elementId:
                type: string
                format: uuid
                description: UUID of the Custom Agent to share.
                example: 7bf5f4d6-743d-414f-aa4a-96f7a20ce0fd
              elementType:
                type: string
                enum:
                  - CUSTOM_AGENT
                description: Must be CUSTOM_AGENT for agent sharing.
              userId:
                type: integer
                description: >-
                  ID of the user to grant access to. Fetch from GET
                  /idp/api/v1/team.
                example: 935
              permission:
                type: string
                enum:
                  - VIEWER
                  - EDITOR
                  - CREATOR
                description: >-
                  VIEWER: view only. EDITOR: view + edit. CREATOR: full access
                  including delete and share.
  securitySchemes:
    ServiceAccountAuth:
      type: apiKey
      in: header
      name: x-auth-token
      description: >
        For server-to-server or automated access, use a DataGOL Service Account
        key.
                Pass it via the `x-auth-token` header instead of `Authorization`:
                `x-auth-token: <service-account-key>`
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        JWT token issued by the DataGOL Identity Provider. Embed `Authorization:
        Bearer <token>` in every request. Tokens contain `companyId`, `userId`,
        `roles`, and `permissions` claims.

````