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

# Update prompt

> Patch prompt sections. Omitted fields stay stored. The server merges, validates, and writes canonical JSON. Do not send a raw `content` blob. `followUps` replaces the whole array (max 3). `delay` is days after the previous message (1-30).

Patch one or more sections. Omitted fields stay stored. The server merges, validates, then writes canonical JSON.

Do not send a `content` blob. Unknown keys are `validation_error`.

## Messages fields

| Field             | Type    | Description                                                                                                                                                        |
| ----------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `context`         | string  | Role and mission. Counts toward mandatory `{{variables}}`. Omit to keep stored.                                                                                    |
| `firstMessage`    | string  | First LinkedIn DM instructions. Counts toward mandatory `{{variables}}`. Omit to keep stored.                                                                      |
| `followUps`       | array   | Replaces the whole list. Max 3 items of `{ prompt, delay }`. `delay` is 1-30 days after the previous message. Omit to keep current follow-ups; send `[]` to clear. |
| `followUpEnabled` | boolean | Turns follow-up sending on or off without deleting `followUps`.                                                                                                    |

To change one delay, copy every follow-up from `GET /prompts/:id` and send the full array.

A 4th follow-up, a delay outside 1-30, or dropped mandatory variables is rejected and nothing is saved.

## Comment fields

| Field     | Type   | Description                                                     |
| --------- | ------ | --------------------------------------------------------------- |
| `comment` | string | Replaces the comment instructions. Invalid on Messages prompts. |

## Example: change follow-up delays

```bash theme={null}
curl -X PUT "https://api.kakiyo.com/v1/prompts/PROMPT_ID" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "followUps": [
      { "prompt": "If they didn'\''t reply, send a short bump.", "delay": 7 },
      { "prompt": "Second bump, mention a relevant post.", "delay": 5 }
    ]
  }'
```


## OpenAPI

````yaml PUT /prompts/{id}
openapi: 3.1.0
info:
  title: Kakiyo API
  description: API for automating LinkedIn outreach campaigns with AI-powered conversations
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.kakiyo.com/v1
security:
  - bearerAuth: []
paths:
  /prompts/{id}:
    put:
      summary: Update Prompt
      description: >-
        Patch prompt sections. Omitted fields stay stored. The server merges,
        validates, and writes canonical JSON. Do not send a raw `content` blob.
        `followUps` replaces the whole array (max 3). `delay` is days after the
        previous message (1-30).
      operationId: updatePrompt
      parameters:
        - name: id
          in: path
          description: ID of the prompt
          required: true
          schema:
            type: string
      requestBody:
        description: Fields to patch. At least one field is required.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePromptRequest'
      responses:
        '200':
          description: Updated prompt sections
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptDetail'
        '400':
          description: >-
            Invalid request, too many follow-ups, invalid delay, or missing
            mandatory variables
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Prompt or model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UpdatePromptRequest:
      type: object
      minProperties: 1
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 3
          maxLength: 100
        model:
          type: string
          description: Model ID from GET /models
        followUpEnabled:
          type: boolean
          description: >-
            Messages only. Turns follow-up sending on or off without deleting
            followUps.
        context:
          type: string
          description: Messages only. Omit to keep the stored context.
        firstMessage:
          type: string
          description: Messages only. Omit to keep the stored first message.
        followUps:
          type: array
          maxItems: 3
          items:
            $ref: '#/components/schemas/PromptFollowUp'
          description: >-
            Messages only. Replaces the whole array. Omit to keep current
            follow-ups; send [] to clear. To change one delay, resend every
            item.
        comment:
          type: string
          minLength: 1
          description: Comment prompts only.
    PromptDetail:
      type: object
      properties:
        id:
          type: string
          example: prompt_987654321
        name:
          type: string
          example: Sales Outreach Sequence
        type:
          type: string
          enum:
            - Messages
            - Comment
          example: Messages
        model:
          type: string
          example: model_claude3
        followUpEnabled:
          type: boolean
          description: Whether follow-ups are sent. Does not delete stored followUps.
          example: true
        variables:
          type: array
          items:
            type: string
          description: Custom variable names used in this prompt
        context:
          type: string
          description: Messages only. Role and mission. Counts toward mandatory variables.
        firstMessage:
          type: string
          description: >-
            Messages only. First LinkedIn DM instructions. Counts toward
            mandatory variables.
        followUps:
          type: array
          maxItems: 3
          items:
            $ref: '#/components/schemas/PromptFollowUp'
          description: Messages only. Max 3 items.
        comment:
          type: string
          description: Comment prompts only.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        guidelines:
          type: object
          description: Schema, mandatory variables, and update rules for this prompt
          additionalProperties: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: validation_error
        message:
          type: string
          example: The request parameters failed validation
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                example: name
              message:
                type: string
                example: The name field is required
    PromptFollowUp:
      type: object
      required:
        - prompt
        - delay
      properties:
        prompt:
          type: string
          description: Follow-up instruction text
          example: If they didn't reply, send a short bump.
        delay:
          type: integer
          minimum: 1
          maximum: 30
          description: Days after the previous message
          example: 3
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````