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

# Update collection playbook

> Update a collection playbook; `steps` and `senders`, when sent, replace the current lists.



## OpenAPI

````yaml patch /v1/collections/playbooks/{id}
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v1/collections/playbooks/{id}:
    patch:
      tags:
        - Collections > Playbooks
      summary: Update collection playbook
      description: >-
        Update a collection playbook; `steps` and `senders`, when sent, replace
        the current lists.
      operationId: updateCollectionPlaybook
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        description: Playbook fields to change
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCollectionPlaybook'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollectionPlaybook'
        '403':
          description: Collections is not enabled on the account
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '404':
          description: Playbook not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
      security:
        - bearer: []
components:
  schemas:
    UpdateCollectionPlaybook:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          description: Name of the playbook.
        segment_ids:
          type: array
          items:
            type: string
          maxItems: 50
          description: >-
            IDs of the customer segments the playbook applies to. Empty when it
            only applies as the default playbook or by customer assignment.
        priority:
          type: integer
          minimum: 0
          maximum: 10000
          description: >-
            Priority of the playbook. When several playbooks match a customer,
            the highest priority wins.
        reminder_sequence_id:
          type:
            - string
            - 'null'
          description: >-
            ID of the invoice reminder sequence linked to the playbook. Invoice
            reminders keep running from it.
        triggers:
          $ref: '#/components/schemas/CollectionPlaybookTriggers'
        agent_mode:
          type: string
          enum:
            - 'off'
            - suggest
            - automatic
          description: >-
            How the collection agent acts on the playbook's cases: `off`,
            `suggest` (a person approves each action) or `automatic`. Defaults
            to `suggest` on creation. A playbook without steps cannot be `off`.
        context:
          type:
            - string
            - 'null'
          maxLength: 10000
          description: Context the agent reads on the playbook's cases.
        silence_checkpoint_days:
          type: integer
          minimum: 1
          maximum: 30
          description: >-
            Days without an answer after the last email before the agent reviews
            the case.
        steps:
          type: array
          items:
            type: object
            properties:
              kind:
                type: string
                enum:
                  - email
                  - task
                  - call
                  - escalate
                  - pause_service
                description: Kind of the step.
              offset_days:
                type: integer
                minimum: 0
                maximum: 365
                description: Days after the case opening when the step runs.
              repeat_every:
                type:
                  - integer
                  - 'null'
                minimum: 1
                maximum: 90
                description: Days between two runs of the step. `null` runs it once.
              template_id:
                type:
                  - string
                  - 'null'
                enum:
                  - reminder
                  - firm_reminder
                  - final_notice
                description: ID of the email template the step sends.
              assignee_role:
                type:
                  - string
                  - 'null'
                minLength: 1
                description: Role of the person a task or call step is assigned to.
            required:
              - kind
              - offset_days
          maxItems: 30
          description: Recovery steps run once a case is open, in order.
        senders:
          type: array
          items:
            type: object
            properties:
              sender_id:
                type: string
                description: ID of the sender profile.
              is_default:
                type: boolean
                description: Whether the sender is the playbook's default sender.
            required:
              - sender_id
              - is_default
          maxItems: 20
          description: Sender profiles the playbook's emails are sent as.
        is_default:
          type: boolean
          enum:
            - true
          description: >-
            Set to `true` to make this playbook the default one. To change the
            default, set it on another playbook.
    CollectionPlaybook:
      type: object
      properties:
        id:
          type: string
          description: Collection playbook ID.
          example: cpb_2bHxVsTaFsPgMf
        name:
          type: string
          description: Name of the playbook.
          example: Late invoices
        segment_ids:
          type: array
          items:
            type: string
          description: >-
            IDs of the customer segments the playbook applies to. Empty when it
            only applies as the default playbook or by customer assignment.
        priority:
          type: integer
          description: >-
            Priority of the playbook. When several playbooks match a customer,
            the highest priority wins.
        reminder_sequence_id:
          type:
            - string
            - 'null'
          description: >-
            ID of the invoice reminder sequence linked to the playbook. Invoice
            reminders keep running from it.
        triggers:
          $ref: '#/components/schemas/CollectionPlaybookTriggers'
        agent_mode:
          type: string
          enum:
            - 'off'
            - suggest
            - automatic
          description: >-
            How the collection agent acts on the playbook's cases: `off`,
            `suggest` (a person approves each action) or `automatic`. Defaults
            to `suggest` on creation. A playbook without steps cannot be `off`.
        context:
          type:
            - string
            - 'null'
          description: Context the agent reads on the playbook's cases.
        is_default:
          type: boolean
          description: >-
            Whether the playbook is the default one, applied when no other
            playbook matches. Setting it moves the default to this playbook.
        silence_checkpoint_days:
          type: integer
          description: >-
            Days without an answer after the last email before the agent reviews
            the case.
        steps:
          type: array
          items:
            $ref: '#/components/schemas/CollectionPlaybookStep'
          description: Recovery steps run once a case is open, in order.
        senders:
          type: array
          items:
            type: object
            properties:
              sender_id:
                type: string
                description: ID of the sender profile.
              is_default:
                type: boolean
                description: Whether the sender is the playbook's default sender.
            required:
              - sender_id
              - is_default
          description: Sender profiles the playbook's emails are sent as.
        open_cases_count:
          type: integer
          description: Number of open cases running the playbook.
        created_at:
          type: string
          format: date-time
          description: Creation date.
          example: '2024-12-20T16:04:11Z'
        updated_at:
          type: string
          format: date-time
          description: Last update date.
          example: '2024-12-20T16:04:11Z'
      required:
        - id
        - name
        - segment_ids
        - priority
        - reminder_sequence_id
        - triggers
        - agent_mode
        - context
        - is_default
        - silence_checkpoint_days
        - steps
        - senders
        - open_cases_count
        - created_at
        - updated_at
    CollectionPlaybookTriggers:
      type: object
      properties:
        days_late:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 365
          description: >-
            Days past the due date of the oldest late invoice. `null` disables
            this trigger.
          example: 15
        amount_over:
          type:
            - string
            - 'null'
          pattern: ^\d+(\.\d+)?$
          description: >-
            Late balance, in major units, above which a case opens. `null`
            disables this trigger.
          example: '500'
        failed_payments:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 20
          description: >-
            Number of failed payment attempts that opens a case. `null` disables
            this trigger.
          example: 2
        broken_promise:
          type: boolean
          description: Whether a broken payment promise opens a case.
      required:
        - days_late
        - amount_over
        - failed_payments
        - broken_promise
      description: >-
        Conditions that open a case on a customer. A case opens when one of the
        set conditions is met.
    CollectionPlaybookStep:
      type: object
      properties:
        id:
          type: string
          description: Playbook step ID.
        position:
          type: integer
          description: Position of the step in the playbook, from 0.
        kind:
          type: string
          enum:
            - email
            - task
            - call
            - escalate
            - pause_service
          description: Kind of the step.
        offset_days:
          type: integer
          description: Days after the case opening when the step runs.
        repeat_every:
          type:
            - integer
            - 'null'
          description: Days between two runs of the step. `null` runs it once.
        template_id:
          type:
            - string
            - 'null'
          description: ID of the email template the step sends.
        assignee_role:
          type:
            - string
            - 'null'
          description: Role of the person a task or call step is assigned to.
      required:
        - id
        - position
        - kind
        - offset_days
        - repeat_every
        - template_id
        - assignee_role
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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