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

# List opportunities

> Deals across your pipelines, most recently updated first. `value` is a decimal string and always accompanies `currency`.



## OpenAPI

````yaml /openapi.json get /opportunities
openapi: 3.1.0
info:
  title: Leadey API
  version: 1.4.0
  description: >-
    The Leadey API gives you programmatic access to your workspace: leads,
    companies, contacts, campaigns, meetings, opportunities and calls, plus the
    reporting metrics behind the Cockpit.


    Every request is authenticated with an organization-scoped API key, and
    every response is JSON. Reads work with any key. Writes — creating leads,
    adding notes, logging calls, managing tasks — need a key with write access,
    and are attributed to the workspace member that key belongs to. See [Writing
    data](/guides/writing-data).
servers:
  - url: https://backend.leadey.ai/v1
    description: Production
  - url: http://localhost:3001/v1
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Account
    description: The organization behind the API key.
  - name: Leads
    description: People enrolled in your campaigns.
  - name: Notes
    description: >-
      Free-text notes on a lead. Notes appear in the lead's timeline and in the
      Cockpit.
  - name: Tasks
    description: Follow-ups and reminders, each assigned to a workspace member.
  - name: Campaigns
    description: Outreach sequences and their performance.
  - name: Companies
    description: Companies in your workspace.
  - name: Contacts
    description: The canonical person record behind your leads.
  - name: Meetings
    description: Bookings merged across Calendly, Leadey and connected calendars.
  - name: Opportunities
    description: Deals, their value, and the pipelines they sit in.
  - name: Pipelines
    description: Deal pipelines and the stages inside them.
  - name: Calls
    description: Dial history, recordings and transcripts.
  - name: Metrics
    description: >-
      Aggregated reporting — meetings booked, sit rate, dial activity and
      pipeline value.
  - name: Reference
    description: The vocabularies other endpoints return values from.
paths:
  /opportunities:
    get:
      tags:
        - Opportunities
      summary: List opportunities
      description: >-
        Deals across your pipelines, most recently updated first. `value` is a
        decimal string and always accompanies `currency`.
      operationId: listOpportunities
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Search'
        - name: pipelineId
          in: query
          description: Only deals in this pipeline.
          schema:
            type: string
        - name: stageId
          in: query
          description: Only deals in this stage.
          schema:
            type: string
        - name: status
          in: query
          description: Filter by the stage's type.
          schema:
            type: string
            enum:
              - open
              - won
              - lost
        - name: ownerId
          in: query
          description: Only deals owned by this user.
          schema:
            type: string
        - name: currency
          in: query
          description: ISO currency code, e.g. `GBP`.
          schema:
            type: string
        - name: minValue
          in: query
          description: Minimum deal value, compared numerically.
          schema:
            type: string
            example: '1000'
        - name: maxValue
          in: query
          description: Maximum deal value, compared numerically.
          schema:
            type: string
        - name: expectedCloseAfter
          in: query
          description: Expected close on or after this date.
          schema:
            type: string
            format: date
        - name: expectedCloseBefore
          in: query
          description: Expected close on or before this date.
          schema:
            type: string
            format: date
        - name: createdFrom
          in: query
          description: Created on or after.
          schema:
            type: string
            format: date-time
        - name: createdTo
          in: query
          description: Created on or before.
          schema:
            type: string
            format: date-time
        - name: closedFrom
          in: query
          description: Closed on or after.
          schema:
            type: string
            format: date-time
        - name: closedTo
          in: query
          description: Closed on or before.
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Opportunity'
                  meta:
                    $ref: '#/components/schemas/PageMeta'
              example:
                data:
                  - id: opp_7Hs2nQbF
                    name: Northwind Logistics — fleet rollout
                    value: '15000.50'
                    currency: GBP
                    probability: 40
                    status: open
                    pipelineId: pl_default
                    stageId: stg_negotiation
                    stageLabel: Negotiation
                    ownerId: user_2pXn4Rk
                    companyId: cmp_4Wd7hLpA
                    contactId: ct_1Bn5zTqE
                    sourceLeadId: lead_8Kq2mXvR
                    expectedCloseDate: '2026-09-30'
                    closedAt: '2026-08-11T15:00:00.000Z'
                    lostReason: Went with an incumbent supplier
                    createdAt: '2026-07-14T09:12:44.000Z'
                    updatedAt: '2026-08-02T16:30:05.000Z'
                meta:
                  page: 1
                  pageSize: 25
                  totalCount: 134
                  totalPages: 6
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    Page:
      name: page
      in: query
      description: 1-based page number.
      schema:
        type: integer
        minimum: 1
        default: 1
    PageSize:
      name: pageSize
      in: query
      description: Items per page (max 100).
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
    Search:
      name: search
      in: query
      description: Free-text search across the resource's key fields.
      schema:
        type: string
  schemas:
    Opportunity:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        value:
          type: string
          description: >-
            Decimal string with 2 places. A string, not a number, so no
            precision is lost in transit.
          example: '15000.50'
        currency:
          type: string
          example: GBP
        probability:
          type: integer
          description: >-
            Effective close probability: the deal's own override if set,
            otherwise its stage's default.
          example: 40
        status:
          type:
            - string
            - 'null'
          enum:
            - open
            - won
            - lost
            - null
          description: Derived from the stage's type.
        pipelineId:
          type: string
        stageId:
          type: string
        stageLabel:
          type:
            - string
            - 'null'
        ownerId:
          type:
            - string
            - 'null'
          description: Resolve against `GET /users`.
        companyId:
          type:
            - string
            - 'null'
        contactId:
          type:
            - string
            - 'null'
        sourceLeadId:
          type:
            - string
            - 'null'
          description: The campaign lead this deal was converted from, if any.
        expectedCloseDate:
          type:
            - string
            - 'null'
          format: date
        closedAt:
          type:
            - string
            - 'null'
          format: date-time
        lostReason:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - value
        - currency
        - status
    PageMeta:
      type: object
      properties:
        page:
          type: integer
          example: 1
        pageSize:
          type: integer
          example: 25
        totalCount:
          type: integer
          example: 134
        totalPages:
          type: integer
          example: 6
      required:
        - page
        - pageSize
        - totalCount
        - totalPages
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message.
            details:
              type:
                - object
                - array
                - string
                - 'null'
              description: Optional structured detail.
          required:
            - message
  responses:
    Unauthorized:
      description: The API key is missing, invalid, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Invalid or revoked API key.
              details: null
    RateLimited:
      description: Too many requests. Retry after the period in the `Retry-After` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Rate limit exceeded. Retry in 42s.
              details: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key, created in the Leadey dashboard under Settings → API Keys.
        Send it as `Authorization: Bearer leadey_sk_live_…`.

````