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

# Change the renewal settings

> Changes what you send of the renewal settings, as an admin's save on Settings > Customer Agent > Renewals does, and returns them all, as GET does. `segment` replaces which opportunities are renewals; `amount_field` the field that holds their amount; `forecast` the settings sent (switching it on needs a segment, and the first switch-on sets up forecasting, then forecasts the open renewals that are due); `risks` replaces the whole list. Everything is checked before anything is written: a problem is a 422 naming it, and nothing is saved. A forecast or risk change before forecasting was ever switched on is a 409. A person's key or MCP login is recorded as who changed the forecast settings and risks.



## OpenAPI

````yaml /api/statisfy-api.openapi.json patch /v1/settings/renewals
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/settings/renewals:
    patch:
      tags:
        - settings
      summary: Change the renewal settings
      description: >-
        Changes what you send of the renewal settings, as an admin's save on
        Settings > Customer Agent > Renewals does, and returns them all, as GET
        does. `segment` replaces which opportunities are renewals;
        `amount_field` the field that holds their amount; `forecast` the
        settings sent (switching it on needs a segment, and the first switch-on
        sets up forecasting, then forecasts the open renewals that are due);
        `risks` replaces the whole list. Everything is checked before anything
        is written: a problem is a 422 naming it, and nothing is saved. A
        forecast or risk change before forecasting was ever switched on is a
        409. A person's key or MCP login is recorded as who changed the forecast
        settings and risks.
      operationId: settings_renewals_update
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              examples:
                - forecast:
                    enabled: true
                    window_days: 120
              properties:
                amount_field:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  description: >-
                    The opportunity custom field that holds the renewal amount
                    (a number, decimal or currency field, a /v1/fields key);
                    null for the standard amount field
                  title: Amount Field
                forecast:
                  $ref: '#/components/schemas/ForecastChange'
                  default: null
                  description: The forecast settings to change; those left out stay
                  title: Forecast
                risks:
                  default: null
                  description: >-
                    The whole list the forecast looks for, replacing the saved
                    one: Statisfy's risks to keep, by name, and the workspace's
                    own (at most 40) with their definitions. A Statisfy risk
                    left out is removed; at least one risk stays
                  items:
                    $ref: '#/components/schemas/RiskInput'
                  maxLength: 56
                  title: Risks
                  type: array
                segment:
                  anyOf:
                    - $ref: '#/components/schemas/ConditionInput'
                    - $ref: '#/components/schemas/GroupInput'
                  default: null
                  description: >-
                    The opportunities that are renewals: a condition on an
                    opportunity field or its account's, or an `and` or `or`
                    group of them, as GET returns it. It replaces the saved
                    segment
                  title: Segment
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RenewalSettings'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    ForecastChange:
      additionalProperties: false
      properties:
        enabled:
          default: null
          description: >-
            Switch renewal forecasting on or off. On needs a segment (saved, or
            sent with it)
          title: Enabled
          type: boolean
        hold_days:
          anyOf:
            - maximum: 365
              minimum: 1
              type: integer
            - const: never
              type: string
            - type: 'null'
          default: null
          description: >-
            How many days a person's change to a forecast is kept from the AI
            (1-365), never (the AI does not overwrite a person's change), or
            null for the workspace default
          title: Hold Days
        instructions:
          anyOf:
            - maxLength: 2000
              type: string
            - type: 'null'
          default: null
          description: >-
            The workspace's guidance to the AI; an empty string or null removes
            it
          title: Instructions
        window_days:
          default: null
          description: >-
            How many days before its close date a renewal is forecast: 60, 90,
            120 or 180
          enum:
            - 60
            - 90
            - 120
            - 180
          title: Window Days
          type: integer
      title: ForecastChange
      type: object
    RiskInput:
      additionalProperties: false
      properties:
        built_in:
          default: null
          description: 'As GET returns it; ignored: a risk is Statisfy''s by its name'
          title: Built In
          type: boolean
        definition:
          anyOf:
            - maxLength: 400
              type: string
            - type: 'null'
          default: null
          description: >-
            What it means, as the AI is told. Needed for the workspace's own
            risks; Statisfy's keep theirs
          title: Definition
        name:
          description: 'A risk''s name: one of Statisfy''s to keep it, or the workspace''s own'
          maxLength: 60
          minLength: 1
          title: Name
          type: string
      required:
        - name
      title: RiskInput
      type: object
    ConditionInput:
      additionalProperties: false
      properties:
        field:
          description: >-
            A field key of the object, as GET /v1/fields?object=<object> lists
            it
          maxLength: 200
          minLength: 1
          title: Field
          type: string
        object:
          description: The object the field is on
          title: Object
          type: string
        op:
          description: >-
            eq, neq, gt, gte, lt, lte, in, nin, contains, notcontains, begins,
            ends, exists, notexists, date_relative, not_date_relative or
            date_window, as in the app's filter
          enum:
            - eq
            - neq
            - gt
            - gte
            - lt
            - lte
            - in
            - nin
            - contains
            - notcontains
            - begins
            - ends
            - date_relative
            - not_date_relative
            - date_window
            - exists
            - notexists
          title: Op
          type: string
        value:
          default: null
          description: A list for in and nin; none for exists and notexists
          title: Value
      required:
        - object
        - field
        - op
      title: ConditionInput
      type: object
    GroupInput:
      additionalProperties: false
      properties:
        and:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ConditionInput'
                  - $ref: '#/components/schemas/GroupInput'
              type: array
            - type: 'null'
          default: null
          description: All of these
          title: And
        or:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ConditionInput'
                  - $ref: '#/components/schemas/GroupInput'
              type: array
            - type: 'null'
          default: null
          description: Any of these
          title: Or
      title: GroupInput
      type: object
    RenewalSettings:
      examples:
        - amount_field: renewal_arr
          forecast:
            enabled: true
            hold_days: 30
            instructions: Treat multi-year deals as one.
            window_days: 90
          risks:
            - built_in: true
              definition: the main internal advocate has left or changed role
              name: Champion left
            - built_in: false
              definition: the customer announced a spending freeze
              name: Budget freeze
          segment:
            and:
              - field: type
                object: opportunity
                op: eq
                value: Renewal
      properties:
        amount_field:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The opportunity field that holds the renewal amount (a /v1/fields
            key). Null: the standard amount field
          title: Amount Field
        forecast:
          anyOf:
            - $ref: '#/components/schemas/Forecast'
            - type: 'null'
          description: >-
            The renewal forecast. Null until renewal forecasting is first
            switched on
        risks:
          description: >-
            The risks the forecast looks for: Statisfy's own, less any the
            workspace removed, then the workspace's. Empty until renewal
            forecasting is first switched on
          items:
            $ref: '#/components/schemas/Risk'
          title: Risks
          type: array
        segment:
          anyOf:
            - $ref: '#/components/schemas/ConditionView'
            - $ref: '#/components/schemas/GroupView'
            - type: 'null'
          description: >-
            The opportunities that are renewals: a condition on an opportunity
            field or its account's, or an `and` or `or` group of them, as
            notification rules give their conditions. Null: none chosen yet
          title: Segment
      required:
        - segment
        - amount_field
        - forecast
        - risks
      title: RenewalSettings
      type: object
    Forecast:
      properties:
        enabled:
          description: Whether renewal forecasting is switched on
          title: Enabled
          type: boolean
        hold_days:
          anyOf:
            - type: integer
            - const: never
              type: string
          description: >-
            How many days a person's change to a forecast is kept from the AI;
            never: the AI does not overwrite a person's change
          title: Hold Days
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          description: The workspace's guidance to the AI; null when none is written
          title: Instructions
        window_days:
          description: How many days before its close date a renewal is forecast
          title: Window Days
          type: integer
      required:
        - enabled
        - window_days
        - hold_days
        - instructions
      title: Forecast
      type: object
    Risk:
      properties:
        built_in:
          description: Statisfy's own risk (true) or one the workspace added (false)
          title: Built In
          type: boolean
        definition:
          description: What it means, as the AI is told
          title: Definition
          type: string
        name:
          description: The risk's name
          title: Name
          type: string
      required:
        - name
        - definition
        - built_in
      title: Risk
      type: object
    ConditionView:
      properties:
        field:
          title: Field
          type: string
        object:
          description: 'The object the field is on: account, user, opportunity, ...'
          title: Object
          type: string
        op:
          title: Op
          type: string
        value:
          title: Value
      required:
        - object
        - field
        - op
      title: ConditionView
      type: object
    GroupView:
      properties:
        and:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ConditionView'
                  - $ref: '#/components/schemas/GroupView'
              type: array
            - type: 'null'
          description: All of these
          title: And
        or:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ConditionView'
                  - $ref: '#/components/schemas/GroupView'
              type: array
            - type: 'null'
          description: Any of these
          title: Or
      title: GroupView
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

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