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

# Export organization users

> Exports the organization's users as a CSV or XLSX file.

Only organization admins can export. The file format goes in the required `type` query parameter: `?type=csv` answers a UTF-8 CSV file, `?type=xlsx` an Excel workbook returned base64-encoded. The organization user list's filters apply here too (`status`, `level`, `name`, …; a list filter takes its values comma-separated, `?status=ACTIVE,IN_ONBOARDING`). The file lists up to 1,000 users, newest first, with their name, e-mail, status, access level, creation date and whether they set up multi-factor authentication and a PIN.


## OpenAPI

````yaml /api-reference/identity.openapi.json get /realms/{realmId}/organizations/{organizationId}/users/report
openapi: 3.0.3
info:
  title: Identity
  version: 1.0.0
  description: >-
    Portão 3 identity API. Every endpoint requires a bearer token in the
    Authorization header (Authorization: Bearer <token>) unless its page states
    otherwise; see the Authentication guide. That requirement is not repeated
    per endpoint. Generated by tools/openapi from code (routes + security) and
    the hand-written spec (request/response bodies). 4 app groups run without
    the identity authorizer; publicPatterns enumerates every route they expose,
    except POST /auth/sign-in, documented with HTTP Basic for the API-client
    credentials flow. Confidence tiers: generated:typed=45 copied:manual=0
    unknown=0.
servers:
  - url: https://api.identity.v2.portao3.com.br/
    description: production
  - url: https://api.identity.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Authentication
  - name: Current User
  - name: Custom Fields
  - name: API Clients
  - name: Users
  - name: Organizations
  - name: Groups
  - name: Realms
paths:
  /realms/{realmId}/organizations/{organizationId}/users/report:
    get:
      tags:
        - Users
      summary: Export organization users
      description: Exports the organization's users as a CSV or XLSX file.
      operationId: getRealmsByRealmIdOrganizationsByOrganizationIdUsersReport
      parameters:
        - name: realmId
          in: path
          required: true
          schema:
            type: string
        - name: organizationId
          in: path
          required: true
          schema:
            type: string
        - name: type
          in: query
          required: true
          description: >-
            The file format: `csv` for a UTF-8 CSV file, `xlsx` for an Excel
            workbook returned base64-encoded.
          schema:
            type: string
            enum:
              - csv
              - xlsx
          example: csv
        - name: ids
          in: query
          required: false
          description: >-
            Only the users with these IDs.


            Format: `UUID`


            ---


            Example (comma-separated list):
            `?ids=8f1c2d3e-4b5a-4c6d-9e7f-a1b2c3d4e5f6,29bfc458-6d62-4e37-9a89-dc620926bae5`
          schema:
            maxItems: 100
            type: array
            items:
              type: string
              format: uuid
          style: form
          explode: false
        - name: name
          in: query
          required: false
          description: >-
            Only users whose first or last name contains each word of this text
            (case-insensitive), or whose e-mail contains the whole text.
          schema:
            type: string
            maxLength: 200
          example: Ana Souza
        - name: email
          in: query
          required: false
          description: Only users whose e-mail contains this text (case-insensitive).
          schema:
            type: string
            maxLength: 200
          example: '@acme.com.br'
        - name: document
          in: query
          required: false
          description: >-
            Only users whose document (CPF) contains these characters.
            Punctuation is ignored, so `123.456` and `123456` match the same
            users.
          schema:
            type: string
            maxLength: 32
          example: '12345678909'
        - name: status
          in: query
          required: false
          description: |-
            Only users in one of these statuses.

            ---

            Example (comma-separated list): `?status=ACTIVE,IN_ONBOARDING`
          schema:
            type: array
            items:
              type: string
              enum:
                - IN_ONBOARDING
                - CREATING
                - ACTIVE
                - DEACTIVATED
                - BLOCKED
          style: form
          explode: false
        - name: level
          in: query
          required: false
          description: |-
            Only users with one of these access levels in the organization.

            ---

            Example: `?level=ADMIN`
          schema:
            type: array
            items:
              type: string
              enum:
                - ADMIN
                - USER
          style: form
          explode: false
        - name: realmLevel
          in: query
          required: false
          description: |-
            Only users with one of these access levels in the realm.

            ---

            Example: `?realmLevel=ADMIN`
          schema:
            type: array
            items:
              type: string
              enum:
                - ADMIN
                - USER
          style: form
          explode: false
        - name: hasPin
          in: query
          required: false
          description: >-
            Only users who set up a transaction PIN (`true`) or did not
            (`false`).


            ---


            Example: `?hasPin=true`
          schema:
            type: array
            items:
              anyOf:
                - type: boolean
                - type: string
          style: form
          explode: false
        - name: hasMfa
          in: query
          required: false
          description: >-
            Only users who enabled multi-factor authentication (`true`) or did
            not (`false`).


            ---


            Example: `?hasMfa=true`
          schema:
            type: array
            items:
              anyOf:
                - type: boolean
                - type: string
          style: form
          explode: false
        - name: next
          in: query
          required: false
          description: >-
            Cursor returned as `next` by the previous page of the organization
            user list. Omit to export from the first user.
          schema:
            type: string
          example: NmEzZjljMjFlNGIwN2Q1YThjMTJmM2U5
        - name: orderBy
          in: query
          required: false
          description: Field to sort by. Defaults to `createdAt`.
          schema:
            type: string
            maxLength: 64
          example: createdAt
        - name: order
          in: query
          required: false
          description: Sort direction, `ASC` or `DESC`. Defaults to `DESC` (newest first).
          schema:
            type: string
            maxLength: 8
          example: DESC
      responses:
        '200':
          description: >-
            `application/csv` — The users as a UTF-8 CSV file, when `?type=csv`
            (served with that `Content-Type`).


            `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`
            — The Excel workbook, base64-encoded, when `?type=xlsx`.
          content:
            application/csv:
              schema:
                type: string
                description: >-
                  The users as a UTF-8 CSV file, when `?type=csv` (served with
                  that `Content-Type`).
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                format: byte
                description: The Excel workbook, base64-encoded, when `?type=xlsx`.
        '400':
          description: >-
            `INVALID_TYPE` — The `type` query parameter is missing or is neither
            `csv` nor `xlsx`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - INVALID_TYPE
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - IDENTITY
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: INVALID_TYPE
                origin: IDENTITY
                message: Invalid type
        '403':
          description: >-
            `INSUFFICIENT_PERMISSIONS` — You are not an admin of this
            organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - INSUFFICIENT_PERMISSIONS
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - IDENTITY
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: INSUFFICIENT_PERMISSIONS
                origin: IDENTITY
                message: insufficient permissions

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.