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

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

Only organization admins can export. Choose the file format with the required `type` query parameter: `?type=csv` answers a UTF-8 CSV file, `?type=xlsx` an Excel workbook, returned base64-encoded unless you ask for `encoding=binary`. The supplier list's filters apply here too (`name`, `document`, `status`), and `orderBy` and `order` sort the rows. The file has one row per supplier with its name, trade name, document and document type, phone, e-mail, the address in seven columns, PIX key and key type, status and creation and last update dates. The headers are in Portuguese, while the values are as the API gives them: `Tipo de Documento` is `CPF` or `CNPJ`, `Pix - Tipo` the `pixKeyType` and `Status` is `ACTIVE` or `DEACTIVATED`. The dates are `DD/MM/YYYY HH:mm` in Brasília time. A search that finds nothing gets a file with the header row and one empty row.

The file is sent as an attachment named `fornecedores_<date>.csv` or `.xlsx`. A file of more than 50,000 rows or 4 MiB is refused.


## OpenAPI

````yaml /api-reference/registry.openapi.json get /realms/{realmId}/organizations/{organizationId}/suppliers/suppliers/report
openapi: 3.0.3
info:
  title: Registry
  version: 1.0.0
  description: >-
    Portão 3 registry 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). Confidence tiers:
    generated:typed=37 copied:manual=0 unknown=0.
servers:
  - url: https://api.registry.v2.portao3.com.br/
    description: production
  - url: https://api.registry.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Customers
  - name: Companies
  - name: People
  - name: Products
  - name: Suppliers
paths:
  /realms/{realmId}/organizations/{organizationId}/suppliers/suppliers/report:
    get:
      tags:
        - Suppliers
      summary: Export suppliers
      description: Exports the organization's suppliers as a CSV or XLSX file.
      operationId: getRealmsByRealmIdOrganizationsByOrganizationIdSuppliersSuppliersReport
      parameters:
        - name: realmId
          in: path
          required: true
          description: |-
            ID of your realm.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
        - name: organizationId
          in: path
          required: true
          description: |-
            ID of the organization whose suppliers you want to export.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
        - name: type
          in: query
          required: true
          description: >-
            The file format: `csv` for a UTF-8 CSV file, `xlsx` for an Excel
            workbook.
          schema:
            type: string
            enum:
              - csv
              - xlsx
          example: csv
        - name: encoding
          in: query
          required: false
          description: >-
            How an `xlsx` file is returned: `base64` (the default) as base64
            text, or `binary` as the raw bytes. Ignored for `csv`.
          schema:
            default: base64
            type: string
            enum:
              - base64
              - binary
          example: base64
        - name: name
          in: query
          required: false
          description: >-
            Only suppliers whose name or trade name contains this text
            (case-insensitive).
          schema:
            type: string
            minLength: 1
            maxLength: 50
          example: boa viagem
        - name: document
          in: query
          required: false
          description: >-
            Only suppliers whose document contains these letters and digits
            (case-insensitive). Send it with no dots, slashes or hyphens.
          schema:
            type: string
            pattern: ^[A-Za-z0-9]+$
          example: '112223'
        - name: status
          in: query
          required: false
          description: Only suppliers in this status.
          schema:
            type: string
            enum:
              - ACTIVE
              - DEACTIVATED
          example: ACTIVE
        - name: order
          in: query
          required: false
          description: >-
            Sort direction of the rows. Defaults to `DESC`: newest first when
            sorting by `createdAt`.
          schema:
            default: DESC
            type: string
            enum:
              - ASC
              - DESC
          example: DESC
        - name: orderBy
          in: query
          required: false
          description: Field the rows are sorted by. Defaults to `createdAt`.
          schema:
            default: createdAt
            type: string
            enum:
              - createdAt
              - updatedAt
              - name
              - tradingName
              - document
          example: createdAt
      responses:
        '200':
          description: >-
            `application/csv` — The suppliers as a UTF-8 CSV file, when
            `?type=csv`.


            `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`
            — The Excel workbook, base64-encoded, when `?type=xlsx` (the default
            `encoding=base64`). With `encoding=binary` the body is the raw
            workbook bytes instead of base64 text, but the platform returns
            those bytes as text, so the workbook usually can't be opened from
            it: prefer the default.
          content:
            application/csv:
              schema:
                type: string
                description: The suppliers as a UTF-8 CSV file, when `?type=csv`.
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                format: byte
                description: >-
                  The Excel workbook, base64-encoded, when `?type=xlsx` (the
                  default `encoding=base64`). With `encoding=binary` the body is
                  the raw workbook bytes instead of base64 text, but the
                  platform returns those bytes as text, so the workbook usually
                  can't be opened from it: prefer the default.
        '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:
                      - REGISTRY
                    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: REGISTRY
                message: Invalid type
        '403':
          description: '`FORBIDDEN_SUPPLIER` — You are not an admin of the 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:
                      - FORBIDDEN_SUPPLIER
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - REGISTRY
                    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: FORBIDDEN_SUPPLIER
                origin: REGISTRY
                message: You do not have permission to perform this action on supplier
        '422':
          description: >-
            `BAD_REQUEST` — A path or query parameter is invalid, such as an
            unknown `encoding` or `status`; `fields` lists each one.


            `EXPORT_TOO_LARGE` — The result is too big for one file: more than
            50,000 suppliers, or a file over 4 MiB. Narrow it with `name`,
            `document` or `status`.
          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:
                      - BAD_REQUEST
                      - EXPORT_TOO_LARGE
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - REGISTRY
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                  fields:
                    type: array
                    description: >-
                      One entry per invalid request field (validation errors
                      only).
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: >-
                            Path of the invalid field, e.g. `label` or
                            `values[0].value`.
                          example: label
                        message:
                          type: string
                          description: Why the field was rejected.
                          example: label is required
                        code:
                          type: string
                          description: >-
                            `<FIELD>_<REASON>` — e.g. `LABEL_REQUIRED`,
                            `TYPE_ONE_OF`, `VALUES_VALUE_TYPE_ERROR`.
                          example: LABEL_REQUIRED
                        values:
                          type: array
                          items:
                            type: string
                          description: >-
                            The accepted values, when the field is an
                            enumeration.
                      required:
                        - field
                        - message
                        - code
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: BAD_REQUEST
                origin: REGISTRY
                message: >-
                  Bad Request: Your request is invalid or incomplete. Please
                  make sure you are requesting with the right fields.
                fields:
                  - field: type
                    message: 'Invalid option: expected one of "csv"|"xlsx"'
                    code: TYPE_ONE_OF
                    values:
                      - csv
                      - xlsx

````

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