> ## 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 Conversation customData

> Updates the per-conversation customData used in prompts as {{customData}}. Pass an empty string to clear it.

## Overview

Update the per-conversation `customData` for an existing chat. `customData` is the prompt context exposed as `{{customData}}`, set when the conversation is created via the prospect import endpoints.

Use this when the context that personalizes a conversation changes after import (for example, the lead performed a new action), so the AI prompt always uses the latest context.

## Path parameters

| Field    | Type     | Required | Description                           |
| -------- | -------- | -------- | ------------------------------------- |
| `chatId` | `string` | Yes      | ID of the chat/conversation to update |

## Request body

| Field        | Type     | Required | Description                                                                      |
| ------------ | -------- | -------- | -------------------------------------------------------------------------------- |
| `customData` | `string` | Yes      | New prompt context, max 3000 characters. Pass an empty string (`""`) to clear it |

## Example

```bash theme={null}
curl -X PATCH "https://api.kakiyo.com/v1/prospects/chat_12345abcde/custom-data" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customData": "John replied positively to the AI outbound post; reference that follow-up."
  }'
```

```javascript theme={null}
const response = await fetch('https://api.kakiyo.com/v1/prospects/chat_12345abcde/custom-data', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    customData: 'John replied positively to the AI outbound post; reference that follow-up.',
  }),
});

const result = await response.json();
console.log(result.customDataSaved, result.customDataLength);
```

## Response

```json theme={null}
{
  "message": "Conversation customData updated successfully",
  "chatId": "chat_12345abcde",
  "customDataSaved": true,
  "customDataLength": 64
}
```

## Notes

* The chat must belong to a campaign owned by your team, otherwise the request returns `403`.
* `customData` is truncated to 3000 characters.
* An empty string clears the stored context (`customDataSaved` will be `false`).
* The new value applies to subsequent AI message generations for the conversation.


## OpenAPI

````yaml PATCH /prospects/{chatId}/custom-data
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:
  /prospects/{chatId}/custom-data:
    patch:
      summary: Update Conversation customData
      description: >-
        Updates the per-conversation customData used in prompts as
        {{customData}}. Pass an empty string to clear it.
      operationId: updateConversationCustomData
      parameters:
        - name: chatId
          in: path
          description: ID of the chat/conversation
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - customData
              properties:
                customData:
                  type: string
                  maxLength: 3000
                  description: Per-conversation prompt context. Empty string clears it.
                  example: >-
                    John replied positively to the AI outbound post; reference
                    that follow-up.
      responses:
        '200':
          description: Conversation customData updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Conversation customData updated successfully
                  chatId:
                    type: string
                    example: chat_12345abcde
                  customDataSaved:
                    type: boolean
                    example: true
                  customDataLength:
                    type: integer
                    example: 64
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Conversation not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````