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

# Remove resource scope

> Remove a resource scope from a custom role



## OpenAPI

````yaml /api-reference/openapi/Evo-Auth-Service/custom-roles.yaml delete /api/v1/custom_roles/{id}/remove_resource_scope
openapi: 3.0.1
info:
  title: Evolution Foundation - Auth Service - Custom Roles
  description: Authentication and user and account management
  version: v1.0.0
servers:
  - url: https://api.evoai.app
    description: Production server
  - url: http://localhost:3001
    description: Development server
    variables:
      port:
        default: '3001'
  - url: '{customUrl}'
    description: Custom server
    variables:
      customUrl:
        default: https://your-instance.com
        description: Enter your server URL
security: []
paths:
  /api/v1/custom_roles/{id}/remove_resource_scope:
    parameters:
      - name: account_id
        in: path
        description: Account ID
        required: true
        schema:
          type: string
          format: uuid
      - name: id
        in: path
        description: Custom Role ID
        required: true
        schema:
          type: string
          format: uuid
    delete:
      summary: Remove resource scope
      description: Remove a resource scope from a custom role
      operationId: removeResourceScope
      parameters:
        - name: resource_type
          in: query
          required: true
          schema:
            type: string
        - name: resource_id
          in: query
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Resource scope removed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      resource_scopes:
                        type: array
                  meta:
                    type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                  message:
                    type: string
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                validation_error:
                  summary: Resource type and resource ID are required
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: Resource type and resource ID are required
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/custom_roles/{id}/remove_resource_scope
                      method: DELETE
                account_id_required:
                  summary: Account ID is required
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: >-
                        Account ID is required (provide account-id header or
                        account_id in URL)
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/custom_roles/{id}/remove_resource_scope
                      method: DELETE
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_token:
                  summary: Invalid or missing token
                  value:
                    success: false
                    error:
                      code: INVALID_TOKEN
                      message: Invalid token
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/custom_roles/{id}/remove_resource_scope
                      method: DELETE
        '404':
          description: Not Found (custom role not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                custom_role_not_found:
                  summary: Custom role not found
                  value:
                    success: false
                    error:
                      code: NOT_FOUND
                      message: Custom role not found
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/custom_roles/{id}/remove_resource_scope
                      method: DELETE
        '500':
          description: Internal Server Error (erro interno do servidor)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal_error:
                  summary: Internal server error
                  value:
                    success: false
                    error:
                      code: INTERNAL_ERROR
                      message: An unexpected error occurred
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/custom_roles/{id}/remove_resource_scope
                      method: DELETE
      security:
        - ApiAccessTokenAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - success
        - error
        - meta
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
              example: Validation failed
            details:
              type: object
              additionalProperties: true
              nullable: true
        meta:
          type: object
          required:
            - timestamp
            - path
            - method
          properties:
            timestamp:
              type: string
              format: date-time
              example: '2024-01-15T10:30:00Z'
            path:
              type: string
              example: /api/v1/super_admin/accounts/123
            method:
              type: string
              example: POST
  securitySchemes:
    ApiAccessTokenAuth:
      type: apiKey
      in: header
      name: api_access_token
      description: API access token authentication

````