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

# Update an opportunity

> Update an existing opportunity. To move stages, set pipeline_stage_id. The stage must belong to the opportunity pipeline; PATCH does not accept pipeline_id. There is no cross-pipeline move endpoint; create a new opportunity in the target pipeline.



## OpenAPI

````yaml /api-reference/openapi.yaml patch /v1/opportunities/{id}
openapi: 3.0.1
info:
  title: Slant Public API V1
  version: v1
  description: Public API for creating and managing resources in Slant
  contact:
    name: Slant API Support
    email: api@slant.com
servers:
  - url: https://api.slant.app
security:
  - bearer: []
paths:
  /v1/opportunities/{id}:
    patch:
      tags:
        - Opportunities
      summary: Update an opportunity
      description: >-
        Update an existing opportunity. To move stages, set pipeline_stage_id.
        The stage must belong to the opportunity pipeline; PATCH does not accept
        pipeline_id. There is no cross-pipeline move endpoint; create a new
        opportunity in the target pipeline.
      parameters:
        - name: id
          in: path
          description: The opportunity ID
          required: true
          example: 123e4567-e89b-12d3-a456-426614174000
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
          description: >-
            Unique key to ensure idempotent request handling. If a request with
            the same key was already processed, the original response will be
            returned.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the opportunity
                  example: Updated opportunity
                value:
                  type: integer
                  description: >-
                    The monetary value of the opportunity in whole dollars, not
                    cents
                  example: 750000
                probability:
                  type: integer
                  description: The probability of closing (0-100)
                  example: 80
                target_close_date:
                  type: string
                  format: date-time
                  description: Expected close date
                pipeline_stage_id:
                  type: string
                  description: >-
                    The pipeline stage ID. Must belong to the opportunity
                    pipeline.
                assigned_to_id:
                  type: string
                  description: >-
                    The assigned user ID from the relevant book users list.
                    Prefer this over owner_id.
                owner_id:
                  type: string
                  description: Alias for assigned_to_id
                household_id:
                  type: string
                  description: >-
                    Legacy household ID for household-backed opportunities. Set
                    to null to clear the relationship.
                opportunityable_type:
                  type: string
                  enum:
                    - Household
                    - Contact
                    - Business
                  description: >-
                    Related record type for the opportunity. Must be provided
                    with opportunityable_id.
                opportunityable_id:
                  type: string
                  description: >-
                    Related record ID for the opportunity. Must be provided with
                    opportunityable_type. Set opportunityable_type and
                    opportunityable_id to null to clear the relationship.
                custom_fields:
                  type: object
                  description: Custom field values as key-value pairs
        required: true
      responses:
        '200':
          description: opportunity updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Opportunity'
        '400':
          description: bad request - invalid JSON
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - detail
                properties:
                  error:
                    type: string
                    description: Error code
                    enum:
                      - invalid_json
                  detail:
                    oneOf:
                      - type: string
                        description: Human-readable error description
                      - type: array
                        items:
                          type: string
                        description: Array of validation error messages
        '401':
          description: unauthorized - missing or invalid token
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - detail
                properties:
                  error:
                    type: string
                    description: Error code
                    enum:
                      - token_missing
                      - token_invalid
                  detail:
                    oneOf:
                      - type: string
                        description: Human-readable error description
                      - type: array
                        items:
                          type: string
                        description: Array of validation error messages
        '403':
          description: forbidden
        '404':
          description: not found
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - detail
                properties:
                  error:
                    type: string
                    description: Error code
                    enum:
                      - record_not_found
                  detail:
                    oneOf:
                      - type: string
                        description: Human-readable error description
                      - type: array
                        items:
                          type: string
                        description: Array of validation error messages
      security:
        - bearer: []
components:
  schemas:
    Opportunity:
      type: object
      required:
        - id
        - name
        - book_id
        - pipeline
        - pipeline_stage
        - assigned_to
      properties:
        id:
          type: string
          description: The opportunity ID
          example: abc123xyz
        name:
          type: string
          description: The name of the opportunity
          example: New Investment Opportunity
        value:
          type: integer
          description: The monetary value of the opportunity in dollars
          example: 5000
          nullable: true
        probability:
          type: integer
          description: The probability of closing (0-100)
          example: 75
          nullable: true
        target_close_date:
          type: string
          format: date-time
          description: Expected close date
          nullable: true
        stage_updated_at:
          type: string
          format: date-time
          description: >-
            When the opportunity last moved stages. Useful for stage aging and
            pipeline reporting.
          nullable: true
        book_id:
          type: string
          description: The book ID
          example: book123xyz
        household_id:
          type: string
          description: The household ID (null for unassociated opportunities)
          example: household123xyz
          nullable: true
        opportunityable_type:
          type: string
          enum:
            - Household
            - Contact
            - Business
          description: The related record type for this opportunity
          nullable: true
        opportunityable_id:
          type: string
          description: The related record ID for this opportunity
          nullable: true
        opportunityable:
          type: object
          description: Compact related record payload for the opportunity
          nullable: true
          properties:
            id:
              type: string
            name:
              type: string
              nullable: true
            type:
              type: string
        pipeline:
          $ref: '#/components/schemas/Pipeline'
        pipeline_stage:
          $ref: '#/components/schemas/PipelineStage'
        custom_fields:
          type: object
          description: Custom field values as key-value pairs
          example:
            lead_source: Referral
        assigned_to:
          allOf:
            - $ref: '#/components/schemas/User'
          description: >-
            The user assigned to this opportunity. Set this with assigned_to_id
            on create or update.
        created_at:
          type: string
          format: date-time
          description: When the opportunity was created
        updated_at:
          type: string
          format: date-time
          description: When the opportunity was last updated
    Pipeline:
      type: object
      required:
        - id
        - name
        - audience_types
      properties:
        id:
          type: string
          description: The pipeline ID
          example: pipeline123xyz
        name:
          type: string
          description: The name of the pipeline
          example: Sales Pipeline
        pipeline_type:
          type: string
          enum:
            - prospect
            - client
          description: Deprecated legacy pipeline type for client/prospect-only pipelines
          example: prospect
          nullable: true
        audience_types:
          type: array
          items:
            type: string
            enum:
              - prospect
              - client
              - contact
              - business
          description: Record audiences supported by this pipeline
        default_pipeline_types:
          type: array
          items:
            type: string
            enum:
              - prospect
              - client
          description: Legacy default client/prospect types served by this pipeline
        book_id:
          type: string
          description: The book ID
          example: book123xyz
          nullable: true
        pipeline_stages:
          type: array
          items:
            $ref: '#/components/schemas/PipelineStage'
          description: Ordered pipeline stages
    PipelineStage:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
          description: The pipeline stage ID
          example: stage123xyz
        name:
          type: string
          description: The name of the pipeline stage
          example: Qualified
        stage_order:
          type: integer
          description: The stage order within the pipeline
          example: 1
        visible:
          type: boolean
          description: Whether this stage is visible by default
          example: true
        default_probability:
          type: integer
          description: Default probability for opportunities in this stage
          example: 50
          nullable: true
    User:
      type: object
      required:
        - id
        - email
        - first_name
        - last_name
      properties:
        id:
          type: string
          description: The ID of the user
          example: abc123xyz
        email:
          type: string
          format: email
          description: Email address of the user
          example: user@example.com
        first_name:
          type: string
          nullable: true
          description: First name of the user
          example: John
        last_name:
          type: string
          nullable: true
          description: Last name of the user
          example: Doe
        api_access:
          type: object
          description: >-
            Authentication details for the current personal access token. Only
            present on /v1/me when authenticating with a PAT.
          properties:
            auth_type:
              type: string
              enum:
                - personal_access_token
              example: personal_access_token
            scope:
              type: string
              enum:
                - read_only
                - read_write
              example: read_write
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: OAuth
      description: OAuth 2.0 Bearer Token from Clerk authentication

````