{
  "openapi": "3.0.3",
  "info": {
    "title": "OctoFunnel Public API",
    "version": "1.0.0-development",
    "description": "Implemented operations on the development channel. General client release is pending. 60 requests/minute per key and 300 per project. Project API keys are created and revoked in Settings → Integrations → API. Cookies and MCP credentials are not accepted."
  },
  "servers": [
    {
      "url": "https://{project}.octofunnel.com/api/v1",
      "variables": {
        "project": {
          "default": "your-project",
          "description": "Your development-enabled project slug"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "ProjectApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ofpk_…"
      }
    }
  },
  "paths": {
    "/contacts": {
      "get": {
        "operationId": "contacts.list",
        "summary": "List and search project contacts",
        "x-required-scope": "contacts:read",
        "x-project-permission": "tools.crm:view",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1000
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "phone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "telegram",
                "whatsapp",
                "instagram",
                "vk",
                "max",
                "messenger",
                "email",
                "web"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string",
                            "nullable": true
                          },
                          "values": {
                            "type": "object",
                            "additionalProperties": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 4000
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "enum": [
                                    "null"
                                  ],
                                  "nullable": true
                                }
                              ]
                            }
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "variables": {
                            "type": "object",
                            "additionalProperties": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "enum": [
                                    "null"
                                  ],
                                  "nullable": true
                                }
                              ]
                            }
                          },
                          "channels": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "telegram",
                                "whatsapp",
                                "instagram",
                                "vk",
                                "max",
                                "messenger",
                                "email",
                                "web"
                              ]
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "values",
                          "tags",
                          "variables",
                          "channels",
                          "created_at",
                          "updated_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "data",
                    "request_id",
                    "next_cursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "contacts.create",
        "summary": "Create a contact",
        "description": "A name or reachable/profile detail is required. Existing email/phone identities return 409; contacts are never merged automatically.",
        "x-required-scope": "contacts:write",
        "x-project-permission": "tools.crm:create",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1–128 printable ASCII characters. Successful results are retained for 24 hours, scoped to project and operation. The same key with different normalized JSON returns 409. Replays require current authorization.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "values": {
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 4000
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "enum": [
                            "null"
                          ],
                          "nullable": true
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "values"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string",
                          "nullable": true
                        },
                        "values": {
                          "type": "object",
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 4000
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              },
                              {
                                "enum": [
                                  "null"
                                ],
                                "nullable": true
                              }
                            ]
                          }
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "variables": {
                          "type": "object",
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              },
                              {
                                "enum": [
                                  "null"
                                ],
                                "nullable": true
                              }
                            ]
                          }
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "telegram",
                              "whatsapp",
                              "instagram",
                              "vk",
                              "max",
                              "messenger",
                              "email",
                              "web"
                            ]
                          }
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updated_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "values",
                        "tags",
                        "variables",
                        "channels",
                        "created_at",
                        "updated_at"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/contacts/{contact_id}": {
      "get": {
        "operationId": "contacts.read",
        "summary": "Read a canonical contact",
        "x-required-scope": "contacts:read",
        "x-project-permission": "tools.crm:view",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Opaque project-scoped contact handle"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string",
                          "nullable": true
                        },
                        "values": {
                          "type": "object",
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 4000
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              },
                              {
                                "enum": [
                                  "null"
                                ],
                                "nullable": true
                              }
                            ]
                          }
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "variables": {
                          "type": "object",
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              },
                              {
                                "enum": [
                                  "null"
                                ],
                                "nullable": true
                              }
                            ]
                          }
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "telegram",
                              "whatsapp",
                              "instagram",
                              "vk",
                              "max",
                              "messenger",
                              "email",
                              "web"
                            ]
                          }
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updated_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "values",
                        "tags",
                        "variables",
                        "channels",
                        "created_at",
                        "updated_at"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "contacts.update",
        "summary": "Update supplied contact fields",
        "description": "Unspecified fields are preserved. Null clears a registered value. Email and phone updates use the canonical identity writer and reset verification.",
        "x-required-scope": "contacts:write",
        "x-project-permission": "tools.crm:edit",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Opaque project-scoped contact handle"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "values": {
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 4000
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "enum": [
                            "null"
                          ],
                          "nullable": true
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "values"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string",
                          "nullable": true
                        },
                        "values": {
                          "type": "object",
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 4000
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              },
                              {
                                "enum": [
                                  "null"
                                ],
                                "nullable": true
                              }
                            ]
                          }
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "variables": {
                          "type": "object",
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              },
                              {
                                "enum": [
                                  "null"
                                ],
                                "nullable": true
                              }
                            ]
                          }
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "telegram",
                              "whatsapp",
                              "instagram",
                              "vk",
                              "max",
                              "messenger",
                              "email",
                              "web"
                            ]
                          }
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updated_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "values",
                        "tags",
                        "variables",
                        "channels",
                        "created_at",
                        "updated_at"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/contacts/{contact_id}/variables": {
      "patch": {
        "operationId": "contacts.variables.update",
        "summary": "Set or remove available contact variables",
        "description": "Only project-declared variables listed by GET /contact-fields are editable. Personal fields, provider facts and system variables are excluded. Unspecified values are preserved; remove wins over set.",
        "x-required-scope": "contacts:write",
        "x-project-permission": "tools.crm:edit",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Opaque project-scoped contact handle"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "set": {
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 4000
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "enum": [
                            "null"
                          ],
                          "nullable": true
                        }
                      ]
                    },
                    "default": {}
                  },
                  "remove": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 160
                    },
                    "maxItems": 100,
                    "default": []
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string",
                          "nullable": true
                        },
                        "values": {
                          "type": "object",
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 4000
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              },
                              {
                                "enum": [
                                  "null"
                                ],
                                "nullable": true
                              }
                            ]
                          }
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "variables": {
                          "type": "object",
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "boolean"
                              },
                              {
                                "enum": [
                                  "null"
                                ],
                                "nullable": true
                              }
                            ]
                          }
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "telegram",
                              "whatsapp",
                              "instagram",
                              "vk",
                              "max",
                              "messenger",
                              "email",
                              "web"
                            ]
                          }
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updated_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "values",
                        "tags",
                        "variables",
                        "channels",
                        "created_at",
                        "updated_at"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/contact-fields": {
      "get": {
        "operationId": "contact-fields.list",
        "summary": "List editable fields and available variable names",
        "x-required-scope": "contacts:read",
        "x-project-permission": "tools.crm:view",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "fields": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "textarea",
                                  "number",
                                  "date",
                                  "boolean",
                                  "email",
                                  "tel"
                                ]
                              },
                              "group": {
                                "type": "string",
                                "enum": [
                                  "basic",
                                  "social",
                                  "details",
                                  "custom"
                                ]
                              },
                              "labelKey": {
                                "type": "string"
                              },
                              "profileBase": {
                                "type": "string"
                              },
                              "channel": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "key",
                              "label",
                              "type",
                              "group"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "variables": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "fields",
                        "variables"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "contact-fields.create",
        "summary": "Create a project custom field",
        "description": "At most 50 definitions per project. Duplicate normalized labels return 409.",
        "x-required-scope": "contacts:write",
        "x-project-permission": "tools.crm:edit",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1–128 printable ASCII characters. Successful results are retained for 24 hours, scoped to project and operation. The same key with different normalized JSON returns 409. Replays require current authorization.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "textarea",
                      "number",
                      "date",
                      "boolean"
                    ]
                  }
                },
                "required": [
                  "label",
                  "type"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "text",
                            "textarea",
                            "number",
                            "date",
                            "boolean"
                          ]
                        },
                        "key": {
                          "type": "string",
                          "pattern": "^custom_[a-f0-9]{24}$"
                        }
                      },
                      "required": [
                        "label",
                        "type",
                        "key"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/tags": {
      "get": {
        "operationId": "tags.list",
        "summary": "List CRM tag catalog entries",
        "x-required-scope": "contacts:read",
        "x-project-permission": "tools.crm:view",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64
                          },
                          "color": {
                            "type": "string",
                            "pattern": "^#[0-9a-f]{6}$"
                          }
                        },
                        "required": [
                          "key",
                          "color"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  },
                  "required": [
                    "data",
                    "request_id",
                    "next_cursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "tags.create",
        "summary": "Create a CRM tag",
        "description": "Tag keys are case-sensitive. This is the CRM catalog; case tags are separate. Existing keys return 409.",
        "x-required-scope": "contacts:write",
        "x-project-permission": "tools.crm:create",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1–128 printable ASCII characters. Successful results are retained for 24 hours, scoped to project and operation. The same key with different normalized JSON returns 409. Replays require current authorization.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "color": {
                    "type": "string",
                    "pattern": "^#[0-9a-f]{6}$"
                  }
                },
                "required": [
                  "key",
                  "color"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        },
                        "color": {
                          "type": "string",
                          "pattern": "^#[0-9a-f]{6}$"
                        }
                      },
                      "required": [
                        "key",
                        "color"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/contacts/{contact_id}/tags/{tag_key}": {
      "put": {
        "operationId": "contacts.tags.assign",
        "summary": "Idempotently assign one CRM tag",
        "x-required-scope": "contacts:write",
        "x-project-permission": "tools.crm:edit",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Opaque project-scoped contact handle"
          },
          {
            "name": "tag_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Case-sensitive tag key, URL-encoded"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "tags"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "contacts.tags.remove",
        "summary": "Idempotently remove one CRM tag",
        "x-required-scope": "contacts:write",
        "x-project-permission": "tools.crm:edit",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "contact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Opaque project-scoped contact handle"
          },
          {
            "name": "tag_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Case-sensitive tag key, URL-encoded"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "tags"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/project": {
      "get": {
        "operationId": "project.read",
        "summary": "Read the project bound to this credential",
        "x-required-scope": "project:read",
        "security": [
          {
            "ProjectApiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "slug",
                        "currency",
                        "scopes"
                      ],
                      "additionalProperties": false
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "402": {
            "description": "Plan limit or feature restriction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or current project permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found in this project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "Identity, definition or idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Invalid input or missing Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "details": {}
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    }
  }
}
