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

# List all endpoint mappings

> Retrieve a list of all endpoint-to-action mappings with optional filtering.

**Authorization**: All authenticated users can list mappings.

**Filtering**: Use the action_filter parameter to show only mappings for
a specific action (exact match on action name).

**Management Interface**: This endpoint is designed for administrative
interfaces and configuration management tools.

**Use Cases**:
- Display current authorization configuration
- Administrative overview of endpoint mappings
- Audit and compliance reporting
- Integration with external configuration management
- Troubleshooting authorization issues



## OpenAPI

````yaml https://raw.githubusercontent.com/prefeitura-rio/heimdall/main/docs/api/openapi.json get /api/v1/mappings/list
openapi: 3.1.0
info:
  title: Heimdall Admin Service
  description: >-
    # Heimdall Admin Service API


    A comprehensive admin service for user and group management with
    authorization powered by Cerbos.


    ## Features


    - **User Management**: Automatic user creation from JWT tokens with
    role-based access control

    - **Group Management**: Create, manage, and assign users to groups with
    hierarchical permissions

    - **Role Management**: Define and assign roles to users and groups

    - **Mapping Management**: Configure API endpoint to action mappings for
    authorization

    - **Action Management**: Define available actions for fine-grained
    permission control

    - **Cerbos Integration**: Policy-based authorization with external Cerbos
    service

    - **Audit Logging**: Comprehensive audit trail for all administrative
    operations

    - **Redis Caching**: High-performance caching for frequently accessed data
  version: 1.0.0
servers:
  - url: https://services.pref.rio/heimdall-admin
    description: Production server
  - url: https://services.staging.app.dados.rio/heimdall-admin
    description: Staging server
security: []
tags:
  - name: health
    description: Service health and readiness checks
  - name: users
    description: >-
      User management operations. Users are automatically created from JWT
      tokens.
  - name: groups
    description: >-
      Group management operations. Groups organize users and can have roles
      assigned.
  - name: memberships
    description: Group membership management. Assign and remove users from groups.
  - name: roles
    description: >-
      Role management operations. Roles define permissions that can be assigned
      to users or groups.
  - name: actions
    description: >-
      Action management operations. Actions define the granular permissions
      available in the system.
  - name: mappings
    description: >-
      API endpoint to action mapping configuration. Maps HTTP endpoints to
      authorization actions.
paths:
  /api/v1/mappings/list:
    get:
      tags:
        - mappings
      summary: List all endpoint mappings
      description: >-
        Retrieve a list of all endpoint-to-action mappings with optional
        filtering.


        **Authorization**: All authenticated users can list mappings.


        **Filtering**: Use the action_filter parameter to show only mappings for

        a specific action (exact match on action name).


        **Management Interface**: This endpoint is designed for administrative

        interfaces and configuration management tools.


        **Use Cases**:

        - Display current authorization configuration

        - Administrative overview of endpoint mappings

        - Audit and compliance reporting

        - Integration with external configuration management

        - Troubleshooting authorization issues
      operationId: list_mappings_api_v1_mappings_list_get
      parameters:
        - name: action_filter
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter mappings by specific action name (exact match)
            title: Action Filter
          description: Filter mappings by specific action name (exact match)
          example: user:read
      responses:
        '200':
          description: Mappings retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MappingDetailResponse'
                title: Response List Mappings Api V1 Mappings List Get
              example:
                - id: 1
                  path_pattern: /api/v1/users/{user_id}
                  method: GET
                  action: user:read
                  description: Get user profile information
                  created_by: '12345678901'
                  created_at: '2024-01-15T10:30:00Z'
                - id: 2
                  path_pattern: /api/v1/groups
                  method: POST
                  action: group:create
                  description: Create new group
                  created_by: '12345678901'
                  created_at: '2024-01-15T11:00:00Z'
                  updated_at: '2024-01-16T09:15:00Z'
        '401':
          description: Unauthorized - Invalid or missing JWT token
          content:
            application/json:
              example:
                detail: Could not validate credentials
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                detail: 'Failed to list mappings: Database connection error'
      security:
        - HTTPBearer: []
components:
  schemas:
    MappingDetailResponse:
      properties:
        id:
          type: integer
          title: Id
          description: Unique identifier of the mapping
          example: 1
        path_pattern:
          type: string
          title: Path Pattern
          description: URL path pattern
          example: /api/v1/users/{user_id}
        method:
          type: string
          title: Method
          description: HTTP method
          example: GET
        action:
          type: string
          title: Action
          description: Action name
          example: user:read
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Mapping description
          example: Get user profile information
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: CPF of the user who created this mapping
          example: '12345678901'
        created_at:
          type: string
          title: Created At
          description: ISO timestamp when the mapping was created
          example: '2024-01-15T10:30:00Z'
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
          description: ISO timestamp when the mapping was last updated
          example: '2024-01-16T14:20:00Z'
      type: object
      required:
        - id
        - path_pattern
        - method
        - action
        - created_at
      title: MappingDetailResponse
      description: Detailed response model for mapping information.
      example:
        action: user:read
        created_at: '2024-01-15T10:30:00Z'
        created_by: '12345678901'
        description: Get user profile information
        id: 1
        method: GET
        path_pattern: /api/v1/users/{user_id}
        updated_at: '2024-01-16T14:20:00Z'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````