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

# Plan Pipeline Change

> What the same body on PUT /pipelines/{id} would strand on the board's deals, and how many it would rewrite. Nothing is written.



## OpenAPI

````yaml https://sonar.turtle.xyz/v1/openapi.json post /organization/{organizationId}/pipelines/{pipelineId}/change-plan
openapi: 3.1.0
info:
  description: >-
    Sonar's CRM, as a tenant sees it: the events its sensors read, the contacts,
    organizations,

    deals, tasks and documents built from them, and the record of every change.
    Each organization's Sonar is its

    own silo: nothing in it is shared with another. Its agent reads the events
    and proposes or makes the changes;

    the people of the organization read, correct and decide. The organization
    graph is the one exception: a public

    directory of organizations, the same for every organization, that holds
    nothing of any organization's own.


    Every path is under /organization/{organizationId}, the Turtle organization
    whose Sonar you address.

    Authenticate with a Turtle API key, as a bearer token or in X-API-Key. A
    personal key acts as you, in the

    organizations you are a member of; an organization's key reaches that
    organization only.


    ## Versioning and deprecation


    v1 is stable. Within v1, changes are additive only:


    - new operations, and new optional query parameters or request fields;

    - new response fields;

    - new values in a response enum.


    Clients must ignore response fields they do not know and tolerate enum
    values they do not know.


    Anything else is breaking and ships only in a new version (/v2): removing or
    renaming an operation, a

    parameter or a field; making an optional input required; changing a type, a
    format or what a field means;

    accepting fewer values than before; changing what a credential may reach.


    An operation is retired in steps. First it is marked deprecated here and
    every answer it gives carries a

    Deprecation header (RFC 9745, the date it was deprecated), a Sunset header
    (RFC 8594, the date it stops

    answering) and a Link to this policy with rel="deprecation". The sunset is
    at least 90 days after the

    deprecation. Watch for the Deprecation header: it is the notice.
  title: Turtle Sonar API
  version: 1.0.0
servers:
  - url: https://sonar.turtle.xyz/v1
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - description: The companies you deal with, your own included.
    name: Organizations
  - description: >-
      The public directory of organizations, the same for every workspace, each
      beside your own organization on its domain.
    name: Organization graph
  - description: People, and the roles they hold at organizations.
    name: Contacts
  - description: >-
      Corrections to a role a contact held: a title misread, a date wrong.
      Starting and finishing one are Contacts operations.
    name: Contact roles
  - description: >-
      Deals on your boards, and the subjects from Turtle's catalog they are
      about.
    name: Engagements (deals)
  - description: 'Storylines: the events one topic is made of.'
    name: Threads (storylines)
  - description: Follow-ups with owners and due dates.
    name: Tasks
  - description: >-
      Paperwork held with a counterparty. Sonar records where a document lives,
      not the file.
    name: Documents
  - description: On-chain addresses an organization is known by.
    name: Wallets
  - description: A deal's changes between two reviews.
    name: Reports
  - description: >-
      What the sensors read. Events never change, and writes cite them as
      evidence.
    name: Events
  - description: Named slices of the event log, each read as a poll of its own.
    name: Feeds
  - description: >-
      Where each poller of the event log stands, and how far behind the log it
      is.
    name: Poll marks
  - description: The schedule, from the calendars Sonar reads.
    name: Meetings
  - description: 'The conversation with Sonar''s agent: questions, answers and notes.'
    name: Messages
  - description: 'The change log: every write, the drafts waiting for a person, and undo.'
    name: Change log and drafts
  - description: Boards, their stages, and the card each deal on them carries.
    name: Pipelines (boards)
  - description: The custom fields every other kind of record carries.
    name: Entity cards
  - description: Rules your workspace runs on incoming events.
    name: Rules
  - description: What the agent may do without a person.
    name: Permissions
  - description: >-
      The accounts Sonar reads through: what each may read, its history reads,
      its settings, and disconnecting it. Connecting one is the dashboard's.
    name: Sensing scope
  - description: What your inbound webhooks received.
    name: Webhook deliveries
  - description: What Sonar holds for you, its retention, and deletion.
    name: Data and retention
  - description: >-
      Keys minted for members' own agents, collected by Sonar's agent tier. Only
      the agent tier's own credential may call these.
    name: Agent keys
paths:
  /organization/{organizationId}/pipelines/{pipelineId}/change-plan:
    post:
      tags:
        - Pipelines (boards)
      summary: Plan Pipeline Change
      description: >-
        What the same body on PUT /pipelines/{id} would strand on the board's
        deals, and how many it would rewrite. Nothing is written.
      operationId: sonarPlanPipelineChange
      parameters:
        - in: path
          name: organizationId
          required: true
          schema:
            $ref: '#/components/schemas/UuidUUID'
        - in: path
          name: pipelineId
          required: true
          schema:
            $ref: '#/components/schemas/UuidUUID'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SonarUpdatePipelineInput'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SonarChangePlanOutput'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrResponse'
          description: Internal Server Error
components:
  schemas:
    UuidUUID:
      examples:
        - 248df4b7-aa70-47b8-a036-33ac447e668d
      format: uuid
      type: string
    SonarUpdatePipelineInput:
      properties:
        aggregates:
          description: >-
            Replaces the board's rollups wholesale. The board's rollups over its
            deals: each {key, label?, source?, op?, stages?, groupBy?}. op is
            sum (default) | min | max | avg | median | count; source is a money,
            percent, number or (min/max) date field, or expectedRevenue,
            optional for count; stages narrows to some columns; groupBy: stage
            turns the number into one point per column.
          items:
            additionalProperties: {}
            type: object
          type: array
        color:
          description: The board's hue, from the chip palette.
          type:
            - 'null'
            - string
        description:
          $ref: '#/components/schemas/SafetextProse'
          description: >-
            What the board is for: which relationships go on it. Sonar reads it
            to pick the board for a new deal. "" removes it.
        draft:
          description: >-
            Hold this write as a draft, even where the permissions would let it
            through: the agent's waits for a person to approve, a person's own
            waits for them to confirm it (owner: its author). The response is
            applied=false with the draft.
          type: boolean
        evidence:
          items:
            $ref: '#/components/schemas/SonarEventRefInput'
          type:
            - array
            - 'null'
        fieldSchema:
          description: >-
            Replaces the board's card wholesale: an ordered list of {key, kind,
            entity?, set?, required?, label?, options?, unit?, section?,
            format?, description?, onCard?, deprecated?}. kind is
            text|number|money|percent|bool|date|enum|ref|stage; ref needs entity
            (contact|organization|document|engagement|task); enum needs options,
            each a string or {value, label?, color?, deprecated?}: value is what
            a card stores, label the words people read, which may be written in
            its place; unit is free text, required on money and optional on
            number; set:true makes the field hold several values, on enum and
            ref only; format (multiline|url|email) is a text rendering hint;
            section is the heading the field groups under; deprecated retires a
            field or an option: records keep what they hold and take no new
            value. Position is display order.
          items:
            additionalProperties: {}
            type: object
          type: array
        migrate:
          $ref: '#/components/schemas/SonarSchemaMigration'
          description: >-
            What becomes of the deals the change strands: deals on a removed
            stage, values in a removed field, a value a field no longer takes, a
            field made required that deals leave empty. A change that strands
            any is refused until it says; POST /pipelines/{id}/change-plan lists
            them. Deprecating a field, option or stage strands nothing.
        rationale:
          $ref: '#/components/schemas/SafetextProse'
        revenueFormula:
          description: >-
            Computes a deal's expectedRevenue from its card when nobody wrote
            one: card keys and numbers joined by + - * /, with parentheses and
            max(a, b). Every key must be a plain money, percent or number field
            on the card. "" removes it.
          type:
            - 'null'
            - string
        revenueUnit:
          $ref: '#/components/schemas/SafetextProseLine'
          description: >-
            What every deal's expectedRevenue on this board is counted in, e.g.
            USD. "" leaves it unstated.
        source:
          description: >-
            With a personal API key only: ai records the write as the key
            owner's agent's (source ai, with the owner as its user), owing the
            rationale and evidence, and passing the permissions, of any agent
            write. Omit for a person's own write.
          enum:
            - ai
          type: string
        stages:
          description: >-
            The board's funnel, in order. Names must be distinct and at least
            one stage must be initial.
          items:
            $ref: '#/components/schemas/SonarStageInput'
          type: array
      type: object
    SonarChangePlanOutput:
      properties:
        records:
          type: integer
        strands:
          items:
            $ref: '#/components/schemas/SonarSchemaStrand'
          type:
            - array
            - 'null'
      type: object
    RestErrResponse:
      properties:
        code:
          description: Application-specific error code.
          type: integer
        context:
          additionalProperties: {}
          description: Application context.
          type: object
        error:
          description: Error message.
          type: string
        status:
          description: Status text.
          type: string
      type: object
    SafetextProse:
      maxLength: 20000
      pattern: ^(?:[^<\p{C}]|[\t\n\r‍]|<+(?:[^<A-Za-z/!?\p{C}]|[\t\n\r‍]|$))*$
      type: string
    SonarEventRefInput:
      properties:
        eventId:
          $ref: '#/components/schemas/UuidUUID'
          description: The event cited; or messageId, one of the two.
        messageId:
          $ref: '#/components/schemas/UuidUUID'
          description: >-
            A teammate's message cited (a text or an answer they sent), instead
            of an event. Supports only.
        quotes:
          description: >-
            Verbatim excerpts of what is cited, showing what was read. An agent
            write needs at least one on a supporting event, or a message.
          items:
            $ref: '#/components/schemas/SafetextProse'
          type: array
        stance:
          description: >-
            supports (default) or retracts — a retraction takes back an event an
            earlier write cited, and needs no quote.
          enum:
            - supports
            - retracts
          type: string
      type: object
    SonarSchemaMigration:
      properties:
        fields:
          additionalProperties:
            type:
              - 'null'
              - string
          type: object
        fill:
          additionalProperties: {}
          type: object
        stages:
          additionalProperties:
            type: string
          type: object
        values:
          additionalProperties:
            additionalProperties: {}
            type: object
          type: object
      type: object
    SafetextProseLine:
      maxLength: 200
      pattern: ^(?:[^<\p{C}]|‍|<+(?:[^<A-Za-z/!?\p{C}]|‍|$))*$
      type: string
    SonarStageInput:
      properties:
        aggregates:
          description: >-
            This column's rollups over the deals on it: each {key, label?,
            source?, op?}. op is sum (default) | min | max | avg | median |
            count.
          items:
            additionalProperties: {}
            type: object
          type: array
        color:
          description: >-
            Chip colour: a hue (grey | red | orange | yellow | lime | green |
            teal | cyan | blue | purple | pink | brown | ink), optionally toned
            1-4 by how far it stands out (blue-2); a bare hue is its 4.
          type: string
        deprecated:
          description: >-
            Retires the stage: the deals on it stay, and none move onto it or
            open there.
          type: boolean
        id:
          $ref: '#/components/schemas/SafetextProseLine'
          description: >-
            Stable handle, minted from the name on first declaration. Send it
            back when renaming; omit it for a new stage.
        kind:
          description: >-
            The phase: lead (where a relationship enters) | discovery | closing
            | launch (in flight) | closed (resolved well) | lost (resolved
            badly).
          type: string
        name:
          $ref: '#/components/schemas/SafetextProseLine'
          minLength: 1
        next:
          description: >-
            Stages this one may lead to, by id or name. Omit to allow any move —
            most boards should. Final stages are reachable from anywhere
            regardless.
          items:
            type: string
          type: array
      required:
        - name
        - kind
      type: object
    SonarSchemaStrand:
      properties:
        default:
          type: string
        field:
          type: string
        kind:
          type: string
        mapped:
          type: boolean
        records:
          type: integer
        stage:
          type: string
        value:
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      description: A Turtle API key (sk_...) as a bearer token.
      scheme: bearer
      type: http
    apiKeyAuth:
      description: A Turtle API key (sk_...).
      in: header
      name: X-API-Key
      type: apiKey

````

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