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

# List opportunities

> Returns opportunities in a required pipeline using cursor pagination with optional stage, search, and field projection. Custom attribute names and value types are returned in `data.custom_field_definitions`; keys in that map match keys under each opportunity's `custom_fields` object.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/opportunities
openapi: 3.1.0
info:
  title: Octolane Public API
  version: 1.0.0
  description: >-
    OpenAPI specification for Octolane public APIs. These endpoints let external
    systems read CRM data and create or update accounts, contacts,
    opportunities, notes, and activities through the public API gateway.
  contact:
    name: Octolane
    url: https://octolane.com
servers:
  - url: https://api.octolane.com
    description: Public API gateway
security:
  - ApiKeyAuth: []
tags:
  - name: CRM
    description: >-
      Public endpoints for creating, bulk creating, listing, searching, and
      updating CRM data.
paths:
  /v1/opportunities:
    get:
      tags:
        - CRM
      summary: List opportunities
      description: >-
        Returns opportunities in a required pipeline using cursor pagination
        with optional stage, search, and field projection. Custom attribute
        names and value types are returned in `data.custom_field_definitions`;
        keys in that map match keys under each opportunity's `custom_fields`
        object.
      operationId: listOpportunitiesV1
      parameters:
        - name: pipeline_id
          in: query
          required: true
          description: Pipeline ID. Required for opportunity reads.
          schema:
            type: string
        - name: stage_id
          in: query
          required: false
          description: Optional stage ID.
          schema:
            type: string
        - name: q
          in: query
          required: false
          description: Free-text search query.
          schema:
            type: string
        - name: cursor
          in: query
          required: false
          description: Opaque pagination cursor returned by a previous page.
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: Maximum number of records.
          schema:
            type: integer
            minimum: 1
            maximum: 500
        - name: fields
          in: query
          required: false
          description: >-
            Optional fields to include. Accepts a comma-separated string or
            repeated array values.
          schema:
            oneOf:
              - type: string
              - type: array
                items:
                  type: string
      responses:
        '200':
          description: Opportunities were returned.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/OpportunitiesListData'
        '400':
          description: The request failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            The API key is missing, invalid, or not allowed to access this
            route.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: The route rate limit was exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
        data:
          description: Endpoint-specific response payload.
      additionalProperties: true
    OpportunitiesListData:
      allOf:
        - $ref: '#/components/schemas/CursorPageFields'
        - type: object
          required:
            - opportunities
            - custom_field_definitions
            - has_more
            - next_cursor
            - limit
          properties:
            opportunities:
              type: array
              items:
                $ref: '#/components/schemas/OpportunityRecord'
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Validation failed
        statusCode:
          type: integer
          example: 400
      additionalProperties: true
    CursorPageFields:
      type: object
      properties:
        custom_field_definitions:
          $ref: '#/components/schemas/CustomFieldDefinitions'
        has_more:
          type: boolean
          description: Whether another page is available.
        next_cursor:
          type:
            - string
            - 'null'
          description: Cursor to pass on the next request when `has_more` is true.
        limit:
          type: integer
          description: Effective page size used for this response.
    OpportunityRecord:
      type: object
      description: Opportunity record. Additional selected system fields may be present.
      properties:
        id:
          type: string
          format: uuid
        name:
          type:
            - string
            - 'null'
        pipeline_id:
          type: string
          format: uuid
        stage_id:
          type:
            - string
            - 'null'
          format: uuid
        stage_name:
          type:
            - string
            - 'null'
        account_id:
          type:
            - string
            - 'null'
          format: uuid
        contact_id:
          type:
            - string
            - 'null'
          format: uuid
        additional_contacts:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalOpportunityContact'
        custom_fields:
          $ref: '#/components/schemas/RecordCustomFields'
      additionalProperties: true
    CustomFieldDefinitions:
      type: object
      description: >-
        Map of custom field slug to definition. This is returned by
        `/v1/accounts`, `/v1/accounts/search`, `/v1/contacts`,
        `/v1/contacts/search`, `/v1/opportunities`, and
        `/v1/opportunities/search`. The map key matches the key used under each
        record's `custom_fields` object. If the request uses `fields`, only
        selected custom fields are included; otherwise all visible custom fields
        for the object are included. For opportunities, definitions are scoped
        to the requested `pipeline_id`.
      additionalProperties:
        $ref: '#/components/schemas/CustomFieldDefinition'
      example:
        last_action_date:
          current_name: Last Action Date
          property_name: custom__last_action_date
          attribute_type: date
          metadata: null
        kola:
          current_name: Kola
          property_name: custom__kola
          attribute_type: multi_select
          metadata:
            options:
              - label: E
                value: e-532837
                color: indigo
    AdditionalOpportunityContact:
      type: object
      properties:
        contact_id:
          type: string
          format: uuid
        contact_first_name:
          type:
            - string
            - 'null'
        contact_last_name:
          type:
            - string
            - 'null'
        contact_email:
          type:
            - string
            - 'null'
          format: email
      additionalProperties: false
    RecordCustomFields:
      type: object
      description: >-
        Custom field values keyed by custom field slug. Use the sibling
        `custom_field_definitions` map in the same response to get each custom
        field's display name (`current_name`), stable property name
        (`property_name`), and value type (`attribute_type`).
      additionalProperties: true
    CustomFieldDefinition:
      type: object
      description: >-
        Definition for one custom field returned under a record's
        `custom_fields` object.
      required:
        - current_name
        - property_name
        - attribute_type
      properties:
        current_name:
          type: string
          description: Display name configured for the custom field.
          example: Last action date
        property_name:
          type: string
          description: >-
            Stable internal property name for the custom field. This can be used
            in field selection, filtering, and update payloads where custom
            properties are accepted.
          example: custom__last_action_date
        attribute_type:
          type: string
          description: >-
            Value type for this custom field. Use this to format request values
            and interpret `custom_fields` values.
          enum:
            - string
            - number
            - checkbox
            - date
            - date_range
            - rating
            - timestamp
            - select
            - multi_select
            - currency
            - percentage
            - location
            - time
            - datetime
            - email
            - phone
            - website
            - url
            - radio
            - team_members
          example: date
        metadata:
          oneOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          description: >-
            Optional field metadata such as select options. Shape depends on
            `attribute_type`.
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Public API key for the Octolane organization.

````