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

# Update sales goal

> Update a sales goal's funnel scope, period, or amount.



## OpenAPI

````yaml /api-reference/cx/swagger.json patch /deals/goals/{goal}
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /deals/goals/{goal}:
    patch:
      tags:
        - deals
      summary: Update sales goal
      description: Update a sales goal's funnel scope, period, or amount.
      parameters:
        - description: Goal ID
          name: goal
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
        description: Goal update data
        required: true
      responses:
        '200':
          description: Update result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_deals_goals.UpdateGoalResponse'
        '400':
          description: Bad request - invalid goal ID or body
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '403':
          description: Forbidden - deals analytics not enabled
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: Goal not found
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_deals_goals.UpdateGoalResponse:
      type: object
      properties:
        goal:
          $ref: >-
            #/components/schemas/stax_ai_cx_cx-api_pkg_routes_deals_reporting.SalesGoal
        ok:
          type: boolean
        warning:
          description: >-
            Set when the update landed but a project it launches didn't
            (ENG-9765).
          type: string
    stax_ai_cx_cx-api_pkg_routes_deals_reporting.SalesGoal:
      type: object
      properties:
        _id:
          type: string
        amount:
          type: number
        created_at:
          type: string
        created_by:
          type: string
        deleted_at:
          type: string
        funnel:
          description: nil = all funnels
          type: string
        period_end:
          type: string
        period_start:
          type: string
        team:
          type: string
        updated_at:
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.