> ## 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.

# Create sales goal

> Create a sales goal ($ bookings target) for a period, optionally scoped to a funnel.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /deals/goals
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:
    post:
      tags:
        - deals
      summary: Create sales goal
      description: >-
        Create a sales goal ($ bookings target) for a period, optionally scoped
        to a funnel.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pkg_routes_deals_goals.NewGoalRequest'
        description: Goal creation data
        required: true
      responses:
        '200':
          description: Created goal
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/stax_ai_cx_cx-api_pkg_routes_deals_reporting.SalesGoal
        '400':
          description: Bad request - invalid body, period, or amount
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '403':
          description: Forbidden - deals analytics not enabled
          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.NewGoalRequest:
      type: object
      properties:
        amount:
          type: number
        funnel:
          description: nil = all funnels
          type: string
        period_end:
          type: string
        period_start:
          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.