Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

2.2 KB
Raw Blame
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "base_version": {
            "description": "Latest version you are editing from. Used for optimistic concurrency checks.",
            "minimum": 1,
            "type": "number"
        },
        "config": {
            "anyOf": [
                {
                    "additionalProperties": {},
                    "properties": {},
                    "type": "object"
                },
                {
                    "type": "null"
                }
            ],
            "description": "JSON object with model parameters or any agent configuration to store with this version. If omitted, the current version's config is carried forward; pass null to clear it. Can be combined with either prompt or edits. Don't store secrets here: config is returned to anyone who can read the prompt."
        },
        "edits": {
            "description": "List of find/replace operations to apply to the current prompt version. Each edit's 'old' text must match exactly once. Edits are applied sequentially. Mutually exclusive with prompt.",
            "items": {
                "properties": {
                    "new": {
                        "description": "Replacement text.",
                        "type": "string"
                    },
                    "old": {
                        "description": "Text to find in the current prompt. Must match exactly once.",
                        "type": "string"
                    }
                },
                "required": ["old", "new"],
                "type": "object"
            },
            "type": "array"
        },
        "prompt": {
            "description": "Full prompt payload to publish as a new version. Mutually exclusive with edits."
        },
        "prompt_name": {
            "pattern": "^[^/]+$",
            "type": "string"
        },
        "version_description": {
            "description": "Optional note describing what changed in this version. Shown in the version history.",
            "maxLength": 400,
            "type": "string"
        }
    },
    "required": ["prompt_name", "base_version"],
    "type": "object"
}