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

# Revoke permission from user or group

> Removes a specific permission relation from a user or group on a resource. Used to revoke roles like owner, admin, developer, operator, or viewer.



## OpenAPI

````yaml /openapi/em-runtime-governance-v2.yaml post /governance/permissions/revoke
openapi: 3.1.0
info:
  title: em_runtime_governance
  version: 5.27.0
servers: []
security: []
paths:
  /governance/permissions/revoke:
    post:
      tags:
        - permissions
      summary: Revoke permission from user or group
      description: >-
        Removes a specific permission relation from a user or group on a
        resource. Used to revoke roles like owner, admin, developer, operator,
        or viewer.
      operationId: revoke_permission
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RevokePermissionRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionResponse'
        '401':
          description: Not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Permission Denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    RevokePermissionRequest:
      properties:
        user_or_group:
          type: string
          title: User Or Group
          description: User ID or group ID (without prefix)
          examples:
            - alice@example.com
            - org-admins
        relation:
          type: string
          title: Relation
          description: Relation to revoke (e.g., 'owner', 'admin', 'viewer')
          examples:
            - owner
            - admin
            - developer
        resource_type:
          type: string
          title: Resource Type
          description: Type of resource (e.g., 'project', 'artifact', 'secret')
          examples:
            - project
            - artifact
            - secret
        resource_id:
          type: string
          title: Resource Id
          description: ID of the resource
          examples:
            - my-project
            - artifact-123
            - artifact-123/api-key
        is_group:
          type: boolean
          title: Is Group
          description: 'Whether the subject is a group (default: False)'
          default: false
      type: object
      required:
        - user_or_group
        - relation
        - resource_type
        - resource_id
      title: RevokePermissionRequest
      description: Request to revoke a permission from a user or group.
    PermissionResponse:
      properties:
        message:
          type: string
          title: Message
          description: Success message
      type: object
      required:
        - message
      title: PermissionResponse
      description: Success response for permission operations.
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - error
      title: ErrorResponse
      description: Standard error response model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorBody:
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          title: Message
        details:
          additionalProperties: true
          type: object
          title: Details
        request_id:
          type: string
          title: Request Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
      type: object
      required:
        - code
        - message
        - request_id
        - timestamp
      title: ErrorBody
      description: Error body with structured details.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ErrorCode:
      type: string
      enum:
        - INVALID_REQUEST
        - INVALID_TOKEN
        - INSUFFICIENT_PERMISSIONS
        - RESOURCE_NOT_FOUND
        - RESOURCE_ALREADY_EXISTS
        - VALIDATION_ERROR
        - RATE_LIMIT_EXCEEDED
        - SERVICE_UNAVAILABLE
        - INTERNAL_ERROR
      title: ErrorCode
      description: Standard error codes for API responses.

````