Monaco Opportunities API

The Opportunities API from Monaco — 3 operation(s) for opportunities.

OpenAPI Specification

monaco-opportunities-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Monaco Public Accounts Opportunities API
  description: Public API for Monaco
  version: 1.0.0
servers:
- url: https://api.monaco.com
tags:
- name: Opportunities
paths:
  /v1/opportunities/list:
    post:
      tags:
      - Opportunities
      summary: List Opportunities
      description: Returns a paginated list of opportunities.
      operationId: list_opportunities
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpportunityListRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicListResponse_OpportunityResponse_'
              example:
                data:
                - id: opp_abc123
                  account_id: acc_def456
                  name: Acme Corp - Enterprise License
                  owner:
                    id: usr_abc123
                    first_name: Jane
                    last_name: Smith
                  stage: negotiation
                  estimated_value:
                    currency_code: USD
                    amount: 5000000
                  estimated_close_date: '2025-09-30'
                  actual_close_date: '2025-10-15'
                  summary: Enterprise deal with strong champion. Procurement review in progress.
                  risks:
                  - Budget constraints
                  - Competing vendor evaluation
                  notes: Follow up after Q3 board meeting
                  tags:
                  - High Priority
                  last_activity_at: '2025-08-20T14:30:00Z'
                  updated_at: '2025-08-21T14:30:00Z'
                  created_at: '2025-06-01T09:00:00Z'
                  custom_field_550e8400-e29b-41d4-a716-446655440001: outbound
                  custom_field_6ba7b810-9dad-11d1-80b4-00c04fd430c8: commit
                pagination:
                  page: 1
                  page_size: 50
                  total_count: 34
                  total_pages: 1
                meta:
                  timestamp: '2026-04-21T12:00:00Z'
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
  /v1/opportunities/{opportunity_id}:
    get:
      tags:
      - Opportunities
      summary: Get an Opportunity
      description: Gets a single opportunity by its `opportunity_id`. The detail response includes the AI-generated summary, identified risks, and custom fields.
      operationId: get_opportunity
      parameters:
      - name: opportunity_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Opportunity Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicItemResponse_OpportunityResponse_'
              example:
                data:
                  id: opp_abc123
                  account_id: acc_def456
                  name: Acme Corp - Enterprise License
                  owner:
                    id: usr_abc123
                    first_name: Jane
                    last_name: Smith
                  stage: negotiation
                  estimated_value:
                    currency_code: USD
                    amount: 5000000
                  estimated_close_date: '2025-09-30'
                  actual_close_date: '2025-10-15'
                  summary: Enterprise deal with strong champion. Procurement review in progress.
                  risks:
                  - Budget constraints
                  - Competing vendor evaluation
                  notes: Follow up after Q3 board meeting
                  tags:
                  - High Priority
                  last_activity_at: '2025-08-20T14:30:00Z'
                  updated_at: '2025-08-21T14:30:00Z'
                  created_at: '2025-06-01T09:00:00Z'
                  custom_field_550e8400-e29b-41d4-a716-446655440001: outbound
                  custom_field_6ba7b810-9dad-11d1-80b4-00c04fd430c8: commit
                  custom_field_f47ac10b-58cc-4372-a567-0e02b2c3d479: Initech
                meta:
                  timestamp: '2026-04-21T12:00:00Z'
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
    patch:
      tags:
      - Opportunities
      summary: Update an Opportunity
      description: Updates an existing opportunity by its `opportunity_id`. Any `tags` list provided **replaces** the existing tags on the opportunity.
      operationId: update_opportunity
      parameters:
      - name: opportunity_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Opportunity Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpportunityUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicItemResponse_OpportunityResponse_'
              example:
                data:
                  id: opp_abc123
                  account_id: acc_def456
                  name: Acme Corp - Enterprise License
                  owner:
                    id: usr_abc123
                    first_name: Jane
                    last_name: Smith
                  stage: closed_won
                  estimated_value:
                    currency_code: USD
                    amount: 5000000
                  estimated_close_date: '2025-09-30'
                  actual_close_date: '2025-10-15'
                  summary: Enterprise deal with strong champion. Procurement review in progress.
                  risks:
                  - Budget constraints
                  - Competing vendor evaluation
                  notes: Follow up after Q3 board meeting
                  tags:
                  - High Priority
                  last_activity_at: '2025-08-20T14:30:00Z'
                  custom_field_550e8400-e29b-41d4-a716-446655440001: outbound
                  updated_at: '2026-04-21T12:00:00Z'
                  created_at: '2025-06-01T09:00:00Z'
                meta:
                  timestamp: '2026-04-21T12:00:00Z'
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
    delete:
      tags:
      - Opportunities
      summary: Delete an Opportunity
      description: Deletes an opportunity by its `opportunity_id`. Returns 204 No Content on success. This is irreversible.
      operationId: delete_opportunity
      parameters:
      - name: opportunity_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Opportunity Id
      responses:
        '204':
          description: Opportunity deleted
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
  /v1/opportunities/:
    post:
      tags:
      - Opportunities
      summary: Create an Opportunity
      description: Creates a new opportunity associated with an existing account. Pass an `idempotency_key` to safely retry creation.
      operationId: create_opportunity
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpportunityCreateRequest'
            examples:
              complete:
                summary: Create opportunity with every field
                value:
                  name: Acme Corp - Enterprise License
                  account_id: 550e8400-e29b-41d4-a716-446655440000
                  owner_user_id: 550e8400-e29b-41d4-a716-446655440001
                  stage: negotiation
                  estimated_value:
                    currency_code: USD
                    amount: 5000000
                  estimated_close_date: '2025-09-30'
                  notes: Follow up after Q3 board meeting
                  tags:
                  - 550e8400-e29b-41d4-a716-446655440002
                  idempotency_key: 550e8400-e29b-41d4-a716-446655440003
                  custom_field_550e8400-e29b-41d4-a716-446655440001: outbound
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicItemResponse_OpportunityResponse_'
              example:
                data:
                  id: opp_abc123
                  account_id: acc_def456
                  name: Acme Corp - Enterprise License
                  owner:
                    id: usr_abc123
                    first_name: Jane
                    last_name: Smith
                  stage: negotiation
                  estimated_value:
                    currency_code: USD
                    amount: 5000000
                  estimated_close_date: '2025-09-30'
                  risks: []
                  notes: Follow up after Q3 board meeting
                  tags: []
                  updated_at: '2026-04-21T12:00:00Z'
                  created_at: '2026-04-21T12:00:00Z'
                  custom_field_550e8400-e29b-41d4-a716-446655440001: outbound
                meta:
                  timestamp: '2026-04-21T12:00:00Z'
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
components:
  schemas:
    OpportunityListRequest:
      properties:
        filters:
          anyOf:
          - items:
              $ref: '#/components/schemas/FilterRule'
            type: array
          - $ref: '#/components/schemas/FilterExpression'
          title: Filters
          description: Filters to apply. Accepts either a flat list of filter rules, implicitly ANDed together, or a recursive filter expression with 'operator' and 'filters'. When an expression omits 'operator', it defaults to 'and'. Filter field names, their valid operators, and allowed values come from GET /v1/schemas/{entity} — each field lists 'allowed_operators' and 'enum_field_settings.allowed_values'. Custom fields are keyed 'custom_field_<uuid>'; related-entity custom fields use '<relation>.custom_field_<uuid>' and are filter-only.
          examples:
          - - condition: contains
              field: name
              value: Acme
            - condition: is
              field: status
              value: active
          - filters:
            - condition: is
              field: status
              value: active
            - filters:
              - condition: contains
                field: name
                value: Acme
              - condition: greater_than
                field: created_at
                value: '2026-01-01'
            operator: or
        page:
          type: integer
          minimum: 1.0
          title: Page
          description: Page number (1-indexed)
          default: 1
          examples:
          - 1
        page_size:
          type: integer
          maximum: 500.0
          minimum: 1.0
          title: Page Size
          description: Number of results per page
          default: 50
          examples:
          - 25
        sort:
          type: string
          title: Sort
          description: Field to sort by. Prefix with '-' for descending order.
          default: -created_at
          examples:
          - -created_at
        include_custom_fields:
          type: boolean
          title: Include Custom Fields
          description: Whether to include custom fields (`custom_field_<uuid>` keys) on each returned opportunity. Defaults to true. Set false to omit them for leaner responses; GET /v1/opportunities/{opportunity_id} always returns them.
          default: true
      type: object
      title: OpportunityListRequest
    OpportunityCreateRequest:
      properties:
        name:
          type: string
          title: Name
          description: Name of the opportunity
          examples:
          - Acme Corp - Enterprise License
        account_id:
          type: string
          format: uuid
          title: Account Id
          description: ID of the account to associate the opportunity with
        owner_user_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Owner User Id
          description: User ID to assign as opportunity owner
        stage:
          anyOf:
          - type: string
          - type: 'null'
          title: Stage
          description: Pipeline stage key for the opportunity
          examples:
          - negotiation
        estimated_value:
          anyOf:
          - $ref: '#/components/schemas/EstimatedValue'
          - type: 'null'
          description: Estimated monetary value of the opportunity
        estimated_close_date:
          anyOf:
          - type: string
          - type: 'null'
          title: Estimated Close Date
          description: Expected close date (YYYY-MM-DD)
          examples:
          - '2025-09-30'
        notes:
          anyOf:
          - type: string
          - type: 'null'
          title: Notes
          description: Notes about the opportunity
          examples:
          - Follow up after Q3 board meeting
        tags:
          anyOf:
          - items:
              type: string
              format: uuid
            type: array
          - type: 'null'
          title: Tags
          description: List of tag IDs to associate with the opportunity
        idempotency_key:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Idempotency Key
          description: Client-provided idempotency key to prevent duplicate creation
      additionalProperties: true
      type: object
      required:
      - name
      - account_id
      title: OpportunityCreateRequest
      description: Request body for creating an opportunity via POST.
    FilterRule:
      properties:
        field:
          type: string
          title: Field
        condition:
          type: string
          title: Condition
        value:
          anyOf:
          - {}
          - type: 'null'
          title: Value
      type: object
      required:
      - field
      - condition
      title: FilterRule
    EstimatedValue:
      properties:
        currency_code:
          anyOf:
          - type: string
          - type: 'null'
          title: Currency Code
          description: ISO 4217 currency code
          examples:
          - USD
        amount:
          anyOf:
          - type: integer
          - type: 'null'
          title: Amount
          description: Value in minor currency units (e.g. cents)
          examples:
          - 5000000
      type: object
      title: EstimatedValue
    OpportunityResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the opportunity
          examples:
          - opp_abc123
        account_id:
          type: string
          title: Account Id
          description: ID of the associated account
          examples:
          - acc_def456
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
          description: Name of the opportunity
          examples:
          - Acme Corp - Enterprise License
        owner:
          anyOf:
          - $ref: '#/components/schemas/OwnerInfo'
          - type: 'null'
          description: User who owns the opportunity
        stage:
          anyOf:
          - type: string
          - type: 'null'
          title: Stage
          description: Current pipeline stage of the opportunity
          examples:
          - negotiation
        estimated_value:
          anyOf:
          - $ref: '#/components/schemas/EstimatedValue'
          - type: 'null'
          description: Estimated monetary value of the opportunity
        estimated_close_date:
          anyOf:
          - type: string
          - type: 'null'
          title: Estimated Close Date
          description: Expected close date for the opportunity
          examples:
          - '2025-09-30'
        actual_close_date:
          anyOf:
          - type: string
          - type: 'null'
          title: Actual Close Date
          description: Actual date the opportunity was closed
          examples:
          - '2025-10-15'
        summary:
          anyOf:
          - type: string
          - type: 'null'
          title: Summary
          description: AI-generated summary of the opportunity
          examples:
          - Enterprise deal with strong champion. Procurement review in progress.
        risks:
          items:
            type: string
          type: array
          title: Risks
          description: Identified risks for the opportunity
          examples:
          - - Budget constraints
            - Competing vendor evaluation
        notes:
          anyOf:
          - type: string
          - type: 'null'
          title: Notes
          description: Notes about the opportunity
          examples:
          - Follow up after Q3 board meeting
        tags:
          items:
            type: string
          type: array
          title: Tags
          description: List of tag names associated with the opportunity
          examples:
          - - High Priority
        last_activity_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Activity At
          description: Date and time of the last activity on the opportunity
          examples:
          - '2025-08-20T14:30:00Z'
        updated_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updated At
          description: Date and time the opportunity record was last updated
          examples:
          - '2025-08-21T14:30:00Z'
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Date and time the opportunity was created
          examples:
          - '2025-06-01T09:00:00Z'
      additionalProperties: true
      type: object
      required:
      - id
      - account_id
      - created_at
      title: OpportunityResponse
      description: 'Opportunity resource.


        Custom fields appear as additional keys prefixed with ``custom_field_``.'
    PublicErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
      - error
      title: PublicErrorResponse
    PublicItemResponse_OpportunityResponse_:
      properties:
        data:
          $ref: '#/components/schemas/OpportunityResponse'
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      type: object
      required:
      - data
      title: PublicItemResponse[OpportunityResponse]
    LogicalOperatorEnum:
      type: string
      enum:
      - and
      - or
      title: LogicalOperatorEnum
      description: Logical operators to combine filters or filter expressions.
    ResponseMeta:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: Server timestamp of the response
      type: object
      title: ResponseMeta
    PaginationInfo:
      properties:
        page:
          type: integer
          title: Page
          description: Current page number
          examples:
          - 1
        page_size:
          type: integer
          title: Page Size
          description: Number of results per page
          examples:
          - 25
        total_count:
          type: integer
          title: Total Count
          description: Total number of matching records
          examples:
          - 142
        total_pages:
          type: integer
          title: Total Pages
          description: Total number of pages
          examples:
          - 6
      type: object
      required:
      - page
      - page_size
      - total_count
      - total_pages
      title: PaginationInfo
    OpportunityUpdateRequest:
      properties:
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
          description: Name of the opportunity
          examples:
          - Acme Corp - Enterprise License
        owner_user_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Owner User Id
          description: User ID to assign as opportunity owner
        stage:
          anyOf:
          - type: string
          - type: 'null'
          title: Stage
          description: Pipeline stage key for the opportunity
          examples:
          - negotiation
        estimated_value:
          anyOf:
          - $ref: '#/components/schemas/EstimatedValue'
          - type: 'null'
          description: Estimated monetary value of the opportunity
        estimated_close_date:
          anyOf:
          - type: string
          - type: 'null'
          title: Estimated Close Date
          description: Expected close date (YYYY-MM-DD)
          examples:
          - '2025-09-30'
        actual_close_date:
          anyOf:
          - type: string
          - type: 'null'
          title: Actual Close Date
          description: Actual date the opportunity was closed (YYYY-MM-DD)
          examples:
          - '2025-10-15'
        notes:
          anyOf:
          - type: string
          - type: 'null'
          title: Notes
          description: Notes about the opportunity
          examples:
          - Follow up after Q3 board meeting
        tags:
          anyOf:
          - items:
              type: string
              format: uuid
            type: array
          - type: 'null'
          title: Tags
          description: List of tag IDs to associate with the opportunity
      additionalProperties: true
      type: object
      title: OpportunityUpdateRequest
      description: Request body for updating an opportunity via PATCH.
    FilterExpression:
      properties:
        operator:
          $ref: '#/components/schemas/LogicalOperatorEnum'
          default: and
        filters:
          items:
            anyOf:
            - $ref: '#/components/schemas/FilterRule'
            - $ref: '#/components/schemas/FilterExpression'
          type: array
          title: Filters
          default: []
      type: object
      title: FilterExpression
      description: 'A filter expression with an explicit operator.


        Contains filters that can be either FilterRule objects (leaf nodes) or

        nested FilterExpression objects (branch nodes), allowing for arbitrarily

        nested filter structures.'
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
          description: Machine-readable error code
          examples:
          - not_found
        message:
          type: string
          title: Message
          description: Human-readable error message
          examples:
          - Resource not found
      type: object
      required:
      - code
      - message
      title: ErrorDetail
    OwnerInfo:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the user
          examples:
          - usr_abc123
        first_name:
          anyOf:
          - type: string
          - type: 'null'
          title: First Name
          description: First name of the user
          examples:
          - Jane
        last_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Name
          description: Last name of the user
          examples:
          - Smith
      type: object
      required:
      - id
      title: OwnerInfo
    PublicListResponse_OpportunityResponse_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/OpportunityResponse'
          type: array
          title: Data
        pagination:
          $ref: '#/components/schemas/PaginationInfo'
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      type: object
      required:
      - data
      - pagination
      title: PublicListResponse[OpportunityResponse]