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

# Listar oportunidades

> Oportunidades da organização, das mais antigas às mais recentes alterações (`updated_at`, `id`). Sem dados pessoais de contato: o título e as notas saem sem o nome, o e-mail, o telefone e o CPF do contato. Funis restritos que quem criou a chave não vê ficam de fora.



## OpenAPI

````yaml https://app.onixfy.com/api/v1/openapi.json get /deals
openapi: 3.1.0
info:
  title: API pública do Onixfy
  version: 1.0.0
  description: >-
    API de leitura (v1) para painéis e BI: oportunidades, histórico de etapas,
    empresas e cadastros, sem dados pessoais de contatos. Autentique com uma
    chave de API (`Authorization: Bearer onx_...`) gerada em Configurações →
    Integrações → Chaves de API.
servers:
  - url: https://app.onixfy.com/api/v1
    description: Produção
security:
  - chaveDeAPI: []
tags:
  - name: Organização
    description: A organização da chave.
  - name: Oportunidades
    description: Oportunidades e o histórico de etapas.
  - name: Empresas
    description: Empresas (razão social, nome fantasia e CNPJ).
  - name: Cadastros
    description: Funis, etapas, motivos de perda, produtos, origens e usuários.
paths:
  /deals:
    get:
      tags:
        - Oportunidades
      summary: Listar oportunidades
      description: >-
        Oportunidades da organização, das mais antigas às mais recentes
        alterações (`updated_at`, `id`). Sem dados pessoais de contato: o título
        e as notas saem sem o nome, o e-mail, o telefone e o CPF do contato.
        Funis restritos que quem criou a chave não vê ficam de fora.
      parameters:
        - name: limit
          in: query
          description: Itens por página (1 a 200; padrão 100).
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 100
        - name: cursor
          in: query
          description: O `next_cursor` da página anterior.
          schema:
            type: string
        - name: updated_since
          in: query
          description: Só o que mudou a partir deste instante (RFC 3339, inclusivo).
          schema:
            type: string
            format: date-time
          example: '2026-12-01T00:00:00Z'
        - name: funnel_id
          in: query
          description: Só as oportunidades deste funil.
          schema:
            type: string
            format: uuid
        - name: status
          in: query
          description: open, won ou lost.
          schema:
            type: string
            enum:
              - open
              - won
              - lost
        - name: created_from
          in: query
          description: Criadas a partir de (RFC 3339 ou AAAA-MM-DD em UTC, inclusivo).
          schema:
            type: string
        - name: created_to
          in: query
          description: >-
            Criadas até (RFC 3339 ou AAAA-MM-DD em UTC; a data sem hora inclui o
            dia inteiro).
          schema:
            type: string
      responses:
        '200':
          description: Sucesso.
          headers:
            X-RateLimit-Limit:
              description: Requisições por minuto desta chave.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Quantas ainda cabem na janela atual.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Quando a janela recomeça (segundos desde 1970, UTC).
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DealList'
        '400':
          description: Parâmetro inválido (`invalid_parameter` ou `invalid_cursor`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Chave ausente, inválida, revogada ou vencida (`api_key_expired`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            A chave não lê a v1, a organização não confere, a assinatura está
            suspensa ou o plano não inclui a API.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Limite da chave (ou do usuário que a criou) excedido.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-RateLimit-Limit:
              description: Requisições por minuto desta chave.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Quantas ainda cabem na janela atual.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Quando a janela recomeça (segundos desde 1970, UTC).
              schema:
                type: integer
            Retry-After:
              description: Segundos até poder tentar de novo.
              schema:
                type: integer
components:
  schemas:
    DealList:
      type: object
      additionalProperties: false
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Deal'
        pagination:
          $ref: '#/components/schemas/Pagination'
    Error:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: >-
                Código estável do erro (ex.: `unauthorized`, `api_key_expired`,
                `forbidden`, `rate_limited`, `invalid_parameter`).
            message:
              type: string
              description: Explicação em português.
    Deal:
      type: object
      additionalProperties: false
      required:
        - id
        - title
        - company
        - value
        - final_value
        - currency
        - funnel
        - stage
        - status
        - created_at
        - updated_at
        - expected_close_date
        - won_at
        - lost_at
        - owner
        - products
        - source
        - loss_reason
      properties:
        id:
          type: string
          format: uuid
        title:
          type:
            - string
            - 'null'
          description: >-
            Título da oportunidade, sem o nome, o e-mail e o telefone do contato
            (LGPD).
        company:
          anyOf:
            - $ref: '#/components/schemas/DealCompany'
            - type: 'null'
        value:
          type:
            - number
            - 'null'
          description: Valor estimado.
        final_value:
          type:
            - number
            - 'null'
          description: Valor final informado no ganho.
        currency:
          type: string
          examples:
            - BRL
          description: Moeda (a da organização).
        funnel:
          anyOf:
            - $ref: '#/components/schemas/Ref'
            - type: 'null'
        stage:
          anyOf:
            - $ref: '#/components/schemas/Ref'
            - type: 'null'
        status:
          type: string
          enum:
            - open
            - won
            - lost
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        expected_close_date:
          type:
            - string
            - 'null'
          format: date
          description: Previsão de fechamento (AAAA-MM-DD).
        won_at:
          type:
            - string
            - 'null'
          format: date-time
        lost_at:
          type:
            - string
            - 'null'
          format: date-time
        owner:
          anyOf:
            - $ref: '#/components/schemas/Ref'
            - type: 'null'
        products:
          type: array
          items:
            $ref: '#/components/schemas/DealProduct'
        source:
          anyOf:
            - $ref: '#/components/schemas/DealSource'
            - type: 'null'
        loss_reason:
          anyOf:
            - $ref: '#/components/schemas/DealLossReason'
            - type: 'null'
      description: Oportunidade, sem dados pessoais de contato.
    Pagination:
      type: object
      additionalProperties: false
      required:
        - next_cursor
        - has_more
      properties:
        next_cursor:
          type:
            - string
            - 'null'
          description: Cursor da próxima página; mande em `cursor`. Nulo na última página.
        has_more:
          type: boolean
          description: Há mais itens depois desta página.
    DealCompany:
      type: object
      additionalProperties: false
      required:
        - id
        - legal_name
        - trade_name
        - cnpj
      properties:
        id:
          type: string
          format: uuid
        legal_name:
          type:
            - string
            - 'null'
          description: Razão social (sem CPF nem telefone).
        trade_name:
          type:
            - string
            - 'null'
          description: Nome fantasia.
        cnpj:
          type:
            - string
            - 'null'
          description: >-
            CNPJ com os 14 dígitos, sem pontuação; nulo quando o campo não tem
            um CNPJ. Mascarado quando quem criou a chave está sob a máscara da
            LGPD.
    Ref:
      type: object
      additionalProperties: false
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
      description: Id e nome de um cadastro.
    DealProduct:
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - quantity
        - value
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        quantity:
          type: number
        value:
          type: number
          description: 'Valor da linha: unitário × quantidade − desconto.'
    DealSource:
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - detail
      properties:
        id:
          type:
            - string
            - 'null'
          format: uuid
        name:
          type: string
          description: Origem (cadastro de origens).
        detail:
          anyOf:
            - $ref: '#/components/schemas/Ref'
            - type: 'null'
    DealLossReason:
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - notes
      properties:
        id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Id do motivo no cadastro (nulo quando o texto não bate com o
            cadastro).
        name:
          type: string
        notes:
          type:
            - string
            - 'null'
          description: Observação da perda (sem dados pessoais).
  securitySchemes:
    chaveDeAPI:
      type: http
      scheme: bearer
      bearerFormat: onx_...
      description: Chave de API do Onixfy (`onx_` + 40 caracteres).

````

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