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

# Save the draft config

> Partial save of the draft agent config columns (prompt, model fields, agentTools, memory, scorers, subagents, etc). Send the `rev` you last read; a stale rev returns 409. `rev` is trigger-owned and must not be sent in the payload. Subagents are `[{ agentId }]`.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/agents/{id}/draft
openapi: 3.1.0
info:
  title: Sidenet API
  version: 1.0.0
  description: >-
    Custom HTTP endpoints exposed by the Sidenet Mastra server. All routes
    require a bearer token and resolve org context from the API key (or the
    `X-Organization-Id` header). This reference is generated from the live route
    definitions in `src/mastra/routes`.
servers:
  - url: ''
security:
  - bearerAuth: []
paths:
  /v1/agents/{id}/draft:
    servers:
      - url: /
    patch:
      tags:
        - Agents
      summary: Save the draft config
      description: >-
        Partial save of the draft agent config columns (prompt, model fields,
        agentTools, memory, scorers, subagents, etc). Send the `rev` you last
        read; a stale rev returns 409. `rev` is trigger-owned and must not be
        sent in the payload. Subagents are `[{ agentId }]`.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: X-Organization-Id
          in: header
          required: false
          schema:
            type: string
          description: >-
            Organization to scope the request to. Optional when authenticating
            with an org API key (the org is taken from the key; if sent, it must
            match). Required when authenticating with the trusted key.
        - name: X-User-Id
          in: header
          required: false
          schema:
            type: string
          description: >-
            End-user identity for the request; user-scoped data (threads,
            memory) resolves to `{orgId}_{userId}`. Required by endpoints that
            read or write user-scoped resources. A `userId` query param (or body
            field, where documented) is accepted as a fallback.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rev
              properties:
                rev:
                  type: integer
                prompt:
                  type: string
                model_name:
                  type: string
                model_provider:
                  type: string
                model_openrouter_slug:
                  type: string
                requesty_model_slug:
                  type: string
                requesty_policy_slug:
                  type: string
                requesty_options:
                  type: object
                model_settings:
                  type: object
                workflows:
                  type: array
                  items:
                    type: string
                agentTools:
                  type: array
                  items:
                    type: object
                description:
                  type: string
                scorers:
                  type: array
                  items:
                    type: object
                agents:
                  type: array
                  items:
                    type: object
                    properties:
                      agentId:
                        type: string
                memory:
                  type: object
      responses:
        '200':
          description: Saved
        '400':
          description: Invalid body
        '404':
          description: Not found
        '409':
          description: Stale rev — reload the draft
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Org API key (scopes the request to its organization) or the shared
        trusted key (requires `X-Organization-Id` on every request).

````