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

# Lista os objetos de um tipo a que o usuário tem a relação

> Até 1000 objetos, como tipo:id; truncated diz se um teto cortou a lista. Exige uma chave secreta criada COM o escopo fga:check (chaves sem restrição não o têm).



## OpenAPI

````yaml /api-reference/openapi.json post /fga/list-objects
openapi: 3.1.0
info:
  title: UNIFOKAL API
  version: v1
  summary: >-
    Verificação de identidade: sessão criada no servidor, jornada no widget,
    resultado no webhook.
  description: >-
    A versão vive no caminho (/v1); não existe header de versão. Adição
    compatível (campo, módulo ou chave nova) NÃO sobe a versão: ignore o que não
    conhecer. Todo erro tem a forma { error, message }: o código é estável, a
    mensagem não. Ids são prefixo + ULID. Webhooks são assinados (HMAC SHA-256
    no header X-IDSAAS-Signature, janela de 300s; o segredo é SEU, mínimo 32
    caracteres) e o header x-idsaas-event carrega o tipo do evento.
  termsOfService: https://unifokal.com/termos
  contact:
    name: UNIFOKAL
    url: https://docs.unifokal.com/
servers:
  - url: https://api.unifokal.com/v1
security: []
externalDocs:
  description: >-
    Documentação completa em https://docs.unifokal.com/. Briefing para agentes
    de IA em https://unifokal.com/llms.txt.
  url: https://docs.unifokal.com/
paths:
  /fga/list-objects:
    post:
      summary: Lista os objetos de um tipo a que o usuário tem a relação
      description: >-
        Até 1000 objetos, como tipo:id; truncated diz se um teto cortou a lista.
        Exige uma chave secreta criada COM o escopo fga:check (chaves sem
        restrição não o têm).
      operationId: listFgaObjects
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FgaListObjectsRequest'
      responses:
        '200':
          description: Os objetos.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FgaListObjectsResponse'
        '400':
          description: >-
            Códigos estáveis: invalid_json, validation_error. Ramifique pelo
            campo error, nunca pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - invalid_json
                          - validation_error
        '401':
          description: >-
            Códigos estáveis: invalid_api_key. Ramifique pelo campo error, nunca
            pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - invalid_api_key
        '403':
          description: >-
            Códigos estáveis: credential_type_not_allowed,
            organization_suspended, test_key_used_in_production,
            insufficient_scope, ip_not_allowed. Ramifique pelo campo error,
            nunca pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - credential_type_not_allowed
                          - organization_suspended
                          - test_key_used_in_production
                          - insufficient_scope
                          - ip_not_allowed
        '404':
          description: >-
            Códigos estáveis: fga_model_not_found. Ramifique pelo campo error,
            nunca pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - fga_model_not_found
        '413':
          description: >-
            Códigos estáveis: payload_too_large. Ramifique pelo campo error,
            nunca pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - payload_too_large
        '422':
          description: >-
            Códigos estáveis: fga_ref_invalid, fga_model_required,
            fga_resolution_limit. Ramifique pelo campo error, nunca pela
            mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - fga_ref_invalid
                          - fga_model_required
                          - fga_resolution_limit
        '429':
          description: >-
            Códigos estáveis: rate_limited. Ramifique pelo campo error, nunca
            pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - rate_limited
      security:
        - secretKey: []
components:
  schemas:
    FgaListObjectsRequest:
      type: object
      properties:
        type:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,49}$
        relation:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,49}$
        user:
          type: string
          minLength: 3
          maxLength: 376
        model_id:
          type: string
          pattern: ^fgm_[0-9A-Z]{26}$
      required:
        - type
        - relation
        - user
    FgaListObjectsResponse:
      type: object
      required:
        - objects
        - truncated
        - model_id
      properties:
        objects:
          type: array
          items:
            type: string
          maxItems: 1000
        truncated:
          type: boolean
          description: true quando um teto de resolução cortou a lista.
        model_id:
          type: string
          pattern: ^fgm_[0-9A-HJKMNP-TV-Z]{26}$
    ErrorEnvelope:
      type: object
      description: >-
        Todo erro da API tem exatamente esta forma. O campo error é um código
        estável (contrato); message é texto livre e pode mudar sem aviso.
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Código estável do erro. Ramifique por ele.
        message:
          type: string
          description: Texto explicativo. NÃO é contrato.
      additionalProperties: false
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: >-
        Chave secreta (unifokal_live_ em produção, unifokal_test_ no sandbox: 64
        hex mais CRC-32) no Authorization: Bearer. Só no seu servidor: nunca no
        browser ou app (o widget monta apenas com o id vs_ da sessão). Não
        existe chave publishable.

````

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