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

# Update an opportunity

> Updates the opportunity with the specified ID. You can update stage, close date, and other opportunity properties.



## OpenAPI

````yaml /openapi-private.json patch /opportunities/{id}
openapi: 3.1.0
info:
  title: Spott API Reference
  version: '0.1'
servers:
  - url: https://api.gospott.com
security: []
tags: []
paths:
  /opportunities/{id}:
    patch:
      tags:
        - Opportunities
      summary: Update an opportunity
      description: >-
        Updates the opportunity with the specified ID. You can update stage,
        close date, and other opportunity properties.
      operationId: updateOpportunity
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOpportunityDto'
      responses:
        '204':
          description: Opportunity updated successfully
        '400':
          description: Bad request - missing or invalid required fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
        '401':
          description: Unauthorized - invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
        '404':
          description: Opportunity not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
        '500':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
      security:
        - x-api-key: []
components:
  schemas:
    UpdateOpportunityDto:
      type: object
      properties:
        companyId:
          type: string
          minLength: 1
          description: The ID of the company this opportunity belongs to
        name:
          type: string
          minLength: 1
          description: The name of the opportunity
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Detailed description of the opportunity
        stageId:
          description: The pipeline stage ID
          type: string
          minLength: 1
        ownerId:
          description: >-
            The user ID of the opportunity owner. Set to null to remove the
            owner.
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
        closeDate:
          description: The target close date. Set to null to clear the close date.
          anyOf:
            - $ref: '#/components/schemas/UpdateOpportunityCloseDateDto'
            - type: 'null'
        clientTeam:
          description: Client contacts to associate with this opportunity
          type: array
          items:
            $ref: '#/components/schemas/IdDto'
        locations:
          description: >-
            Physical locations for the opportunity (0 to 15). Omit to leave
            unchanged; send an empty array to clear all.
          maxItems: 15
          type: array
          items:
            $ref: '#/components/schemas/CreateLocationDto'
      id: PrivateUpdateOpportunityDto
    ExceptionBaseDto:
      type: object
      properties:
        status:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        message:
          type: string
        requestId:
          type: string
      required:
        - status
        - message
        - requestId
      id: ExceptionBaseDto
    UpdateOpportunityCloseDateDto:
      type: object
      properties:
        target:
          anyOf:
            - $ref: '#/components/schemas/DateISO'
            - type: 'null'
          description: Target close date for the opportunity
      required:
        - target
      id: PrivateUpdateOpportunityCloseDateDto
    IdDto:
      type: object
      properties:
        id:
          type: string
          minLength: 1
      required:
        - id
      id: IdDto
    CreateLocationDto:
      type: object
      properties:
        street1:
          anyOf:
            - type: string
            - type: 'null'
        street2:
          anyOf:
            - type: string
            - type: 'null'
        postalCode:
          anyOf:
            - type: string
            - type: 'null'
        city:
          anyOf:
            - type: string
            - type: 'null'
        region:
          anyOf:
            - type: string
            - type: 'null'
        state:
          anyOf:
            - type: string
            - type: 'null'
        country:
          anyOf:
            - type: string
            - type: 'null'
        latitude:
          anyOf:
            - type: number
            - type: 'null'
        longitude:
          anyOf:
            - type: number
            - type: 'null'
        type:
          anyOf:
            - $ref: '#/components/schemas/LocationType'
            - type: 'null'
      required:
        - street1
        - street2
        - postalCode
        - city
        - region
        - state
        - country
        - type
      id: PrivateCreateLocationDto
    DateISO:
      id: DateISO
      format: date-time
      anyOf:
        - type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        - type: string
          format: date
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
    LocationType:
      type: string
      enum:
        - primary_home
        - secondary_home
        - primary_work
        - headquarters
        - regional_office
      id: LocationType
  securitySchemes:
    x-api-key:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        API key for authentication. Get your API key from Settings → API Keys in
        your Spott dashboard.

````