> ## 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.

# Unshare Agent

> Revoke access to a specific agent from one or more users via their email addresses.

Revoke access to a specific Voice Agent for one or more users.

This endpoint is the counterpart to the Share Agent endpoint. Use it when team members change projects, leave the organization, or no longer need visibility into an agent's configuration.

<Warning>
  **Authentication Required:** You must include your API key in the `x-api-key` header to authenticate this request. Only users with administrative rights over the agent should perform this action.
</Warning>

### Required Parameters & Payload

1. **`agentId` (Path Parameter):** The 24-character unique ID of the agent in the URL path.
2. **Request Body:** A JSON payload identifying who should lose access and who is authorizing it.
   * **`email_ids`**: An array of strings containing the email addresses of the users whose access is being revoked.
   * **`admin_user_id`**: The ID of the administrator or owner who is authorizing this unshare action.

### Example Usage

To remove access for two specific users, your request body should look like this:

```json theme={null}
{
  "email_ids": [
    "contractor1@external.com",
    "developer3@yourcompany.com"
  ],
  "admin_user_id": "admin_98765"
}
```


## OpenAPI

````yaml post /agents/{agentId}/unshare
openapi: 3.0.3
info:
  title: Lyzr Voice LiveKit API
  version: 1.0.0
servers:
  - url: https://voice-livekit.studio.lyzr.ai/v1
security: []
paths:
  /agents/{agentId}/unshare:
    post:
      summary: Unshare Agent
      description: >-
        Revoke access to a specific agent from one or more users via their email
        addresses.
      parameters:
        - name: agentId
          in: path
          required: true
          description: The unique identifier of the agent.
          schema:
            type: string
            example: f790923795a23467555c0ad6
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email_ids:
                  type: array
                  description: >-
                    A list of email addresses belonging to the users whose
                    access should be revoked.
                  items:
                    type: string
                    example: former-colleague@company.com
                admin_user_id:
                  type: string
                  description: The ID of the admin user authorizing the unshare operation.
                  example: admin_12345
      responses:
        '200':
          description: Unshare operation completed successfully.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                example:
                  success: true
                  message: Agent unshared successfully
        '400':
          description: Invalid request payload.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                  example:
                    type: object
                    additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````