{
  "openapi": "3.1.0",
  "info": {
    "title": "Trelyn Developer API",
    "version": "1.0.0",
    "description": "Workspace-scoped REST API. 120 requests/minute/key; request bodies at most 64 KiB. Pass record IDs as UUIDs. No DELETE operations. Writes are not idempotent: check before retrying creates. CRM tasks are distinct from project tasks."
  },
  "servers": [
    {
      "url": "/api/v1",
      "description": "Use the same origin as your Trelyn installation"
    }
  ],
  "tags": [
    {
      "name": "companies",
      "description": "Bedrijven"
    },
    {
      "name": "contacts",
      "description": "Contactpersonen"
    },
    {
      "name": "deals",
      "description": "Deals"
    },
    {
      "name": "tasks",
      "description": "CRM-taken"
    },
    {
      "name": "activities",
      "description": "Activiteiten"
    },
    {
      "name": "projects",
      "description": "Projecten"
    },
    {
      "name": "pipelines",
      "description": "Pipelines"
    },
    {
      "name": "members",
      "description": "Teamleden"
    }
  ],
  "x-available-scopes": [
    "companies:read",
    "companies:write",
    "contacts:read",
    "contacts:write",
    "deals:read",
    "deals:write",
    "tasks:read",
    "tasks:write",
    "activities:read",
    "activities:write",
    "projects:read",
    "projects:write",
    "pipelines:read",
    "members:read",
    "deals:values",
    "projects:financials"
  ],
  "paths": {
    "/companies": {
      "get": {
        "operationId": "list_companies",
        "summary": "GET /companies",
        "tags": [
          "companies"
        ],
        "description": "Required scope: companies:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "companies:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "description": "How many to return. Defaults to a sensible page; capped by the server."
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The `nextCursor` from a previous call to this same tool, to get the following page. Omit for the first page. Treat it as opaque."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "create_company",
        "summary": "POST /companies",
        "tags": [
          "companies"
        ],
        "description": "Required scope: companies:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "companies:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "website": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "industry": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/companies/{id}": {
      "get": {
        "operationId": "get_company",
        "summary": "GET /companies/{id}",
        "tags": [
          "companies"
        ],
        "description": "Required scope: companies:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "companies:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "update_company",
        "summary": "PATCH /companies/{id}",
        "tags": [
          "companies"
        ],
        "description": "Required scope: companies:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "companies:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "website": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "industry": {
                    "type": "string"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/contacts": {
      "get": {
        "operationId": "list_contacts",
        "summary": "GET /contacts",
        "tags": [
          "contacts"
        ],
        "description": "Required scope: contacts:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "contacts:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "companyId",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The record's id, as returned by a list or search tool.",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "description": "How many to return. Defaults to a sensible page; capped by the server."
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The `nextCursor` from a previous call to this same tool, to get the following page. Omit for the first page. Treat it as opaque."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "create_contact",
        "summary": "POST /contacts",
        "tags": [
          "contacts"
        ],
        "description": "Required scope: contacts:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "contacts:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string"
                  },
                  "lastName": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "jobTitle": {
                    "type": "string"
                  },
                  "companyId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  }
                },
                "required": [
                  "firstName",
                  "lastName"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/contacts/{id}": {
      "get": {
        "operationId": "get_contact",
        "summary": "GET /contacts/{id}",
        "tags": [
          "contacts"
        ],
        "description": "Required scope: contacts:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "contacts:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "update_contact",
        "summary": "PATCH /contacts/{id}",
        "tags": [
          "contacts"
        ],
        "description": "Required scope: contacts:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "contacts:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string"
                  },
                  "lastName": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "otherEmails": {
                    "type": "array",
                    "description": "Further addresses/numbers, besides the main one. The complete list: anything left out is removed.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Keep the id from get_contact to keep a row's identity."
                        },
                        "value": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string",
                          "description": "Optional, e.g. Work or Private."
                        }
                      },
                      "required": [
                        "value"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "otherPhones": {
                    "type": "array",
                    "description": "Further addresses/numbers, besides the main one. The complete list: anything left out is removed.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Keep the id from get_contact to keep a row's identity."
                        },
                        "value": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string",
                          "description": "Optional, e.g. Work or Private."
                        }
                      },
                      "required": [
                        "value"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "jobTitle": {
                    "type": "string"
                  },
                  "companyId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/deals": {
      "get": {
        "operationId": "list_deals",
        "summary": "GET /deals",
        "tags": [
          "deals"
        ],
        "description": "Required scope: deals:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "deals:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "companyId",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The record's id, as returned by a list or search tool.",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The record's id, as returned by a list or search tool.",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "on_hold",
                "won",
                "lost"
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "description": "How many to return. Defaults to a sensible page; capped by the server."
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The `nextCursor` from a previous call to this same tool, to get the following page. Omit for the first page. Treat it as opaque."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "create_deal",
        "summary": "POST /deals",
        "tags": [
          "deals"
        ],
        "description": "Required scope: deals:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "deals:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "pipelineId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "stageId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "companyId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "contactIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "nextStep": {
                    "type": "string",
                    "description": "What has to happen next on this deal."
                  },
                  "nextActionDate": {
                    "type": "string",
                    "description": "YYYY-MM-DD, when that next step is due."
                  },
                  "source": {
                    "type": "string"
                  },
                  "acquisitionType": {
                    "type": "string",
                    "enum": [
                      "inbound",
                      "outbound",
                      "referral",
                      "existing_client",
                      "partner",
                      "other"
                    ]
                  },
                  "revenueModel": {
                    "type": "string",
                    "enum": [
                      "one_time",
                      "recurring",
                      "hybrid"
                    ],
                    "description": "Pricing model, separate from contractType (agreement type)."
                  },
                  "estimatedBudget": {
                    "type": "number"
                  },
                  "oneTimeRevenue": {
                    "type": "number",
                    "description": "Money billed once."
                  },
                  "mrr": {
                    "type": "number",
                    "description": "Money billed every month."
                  },
                  "contractType": {
                    "type": "string",
                    "enum": [
                      "fixed",
                      "indefinite"
                    ]
                  },
                  "contractTermMonths": {
                    "type": "integer",
                    "description": "Only on a fixed-term contract."
                  }
                },
                "required": [
                  "name",
                  "pipelineId",
                  "stageId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/deals/{id}": {
      "get": {
        "operationId": "get_deal",
        "summary": "GET /deals/{id}",
        "tags": [
          "deals"
        ],
        "description": "Required scope: deals:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "deals:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "update_deal",
        "summary": "PATCH /deals/{id}",
        "tags": [
          "deals"
        ],
        "description": "Required scope: deals:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "deals:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "companyId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "contactIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Replaces the whole list of people on the deal."
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "nextStep": {
                    "type": "string"
                  },
                  "nextActionDate": {
                    "type": "string",
                    "description": "YYYY-MM-DD."
                  },
                  "source": {
                    "type": "string"
                  },
                  "acquisitionType": {
                    "type": "string",
                    "enum": [
                      "inbound",
                      "outbound",
                      "referral",
                      "existing_client",
                      "partner",
                      "other"
                    ]
                  },
                  "revenueModel": {
                    "type": "string",
                    "enum": [
                      "one_time",
                      "recurring",
                      "hybrid"
                    ],
                    "description": "Pricing model, separate from contractType (agreement type)."
                  },
                  "estimatedBudget": {
                    "type": "number"
                  },
                  "oneTimeRevenue": {
                    "type": "number"
                  },
                  "mrr": {
                    "type": "number"
                  },
                  "contractType": {
                    "type": "string",
                    "enum": [
                      "fixed",
                      "indefinite"
                    ]
                  },
                  "contractTermMonths": {
                    "type": "integer"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tasks": {
      "get": {
        "operationId": "list_tasks",
        "summary": "GET /tasks",
        "tags": [
          "tasks"
        ],
        "description": "Required scope: tasks:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "tasks:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "dealId",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The record's id, as returned by a list or search tool.",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The record's id, as returned by a list or search tool.",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "companyId",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The record's id, as returned by a list or search tool.",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "done",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Defaults to false: only tasks still to do."
            }
          },
          {
            "in": "query",
            "name": "dueBefore",
            "required": false,
            "schema": {
              "type": "string",
              "description": "YYYY-MM-DD or ISO timestamp."
            }
          },
          {
            "in": "query",
            "name": "mine",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Only tasks assigned to the person this connection acts as."
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "description": "How many to return. Defaults to a sensible page; capped by the server."
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The `nextCursor` from a previous call to this same tool, to get the following page. Omit for the first page. Treat it as opaque."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "create_task",
        "summary": "POST /tasks",
        "tags": [
          "tasks"
        ],
        "description": "Required scope: tasks:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "tasks:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "description": "What has to be done."
                  },
                  "dueAt": {
                    "type": "string",
                    "description": "When it is due: YYYY-MM-DD, or a full ISO 8601 timestamp for a time of day."
                  },
                  "dealId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "contactId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "companyId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  }
                },
                "required": [
                  "body"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tasks/{id}": {
      "get": {
        "operationId": "get_task",
        "summary": "GET /tasks/{id}",
        "tags": [
          "tasks"
        ],
        "description": "Required scope: tasks:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "tasks:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "update_task",
        "summary": "PATCH /tasks/{id}",
        "tags": [
          "tasks"
        ],
        "description": "Required scope: tasks:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "tasks:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string"
                  },
                  "dueAt": {
                    "type": "string",
                    "description": "YYYY-MM-DD or an ISO 8601 timestamp."
                  },
                  "dealId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "contactId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "companyId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/activities": {
      "get": {
        "operationId": "list_activities",
        "summary": "GET /activities",
        "tags": [
          "activities"
        ],
        "description": "Required scope: activities:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "activities:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "dealId",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The record's id, as returned by a list or search tool.",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The record's id, as returned by a list or search tool.",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "companyId",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The record's id, as returned by a list or search tool.",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "description": "How many to return. Defaults to a sensible page; capped by the server."
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The `nextCursor` from a previous call to this same tool, to get the following page. Omit for the first page. Treat it as opaque."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "create_activity",
        "summary": "POST /activities",
        "tags": [
          "activities"
        ],
        "description": "Required scope: activities:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "activities:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "call",
                      "email",
                      "meeting"
                    ]
                  },
                  "body": {
                    "type": "string"
                  },
                  "dealId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "contactId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "companyId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  }
                },
                "required": [
                  "type",
                  "body"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/activities/{id}": {
      "get": {
        "operationId": "get_activity",
        "summary": "GET /activities/{id}",
        "tags": [
          "activities"
        ],
        "description": "Required scope: activities:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "activities:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/projects": {
      "get": {
        "operationId": "list_projects",
        "summary": "GET /projects",
        "tags": [
          "projects"
        ],
        "description": "Required scope: projects:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "projects:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "description": "How many to return. Defaults to a sensible page; capped by the server."
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The `nextCursor` from a previous call to this same tool, to get the following page. Omit for the first page. Treat it as opaque."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "create_project",
        "summary": "POST /projects",
        "tags": [
          "projects"
        ],
        "description": "Required scope: projects:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "projects:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "planning",
                      "active",
                      "on_hold",
                      "completed",
                      "cancelled"
                    ],
                    "description": "Default planning."
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "none",
                      "low",
                      "medium",
                      "high",
                      "urgent"
                    ]
                  },
                  "projectType": {
                    "type": "string",
                    "description": "Free text, like \"Website\" or \"Branding\"."
                  },
                  "startDate": {
                    "type": "string",
                    "description": "A date, YYYY-MM-DD."
                  },
                  "endDate": {
                    "type": "string",
                    "description": "A date, YYYY-MM-DD."
                  },
                  "companyId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "contactId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "dealId": {
                    "type": "string",
                    "description": "Needs deal access.",
                    "format": "uuid"
                  },
                  "ownerUserId": {
                    "type": "string",
                    "description": "A member's id, from list_members.",
                    "format": "uuid"
                  },
                  "engagementId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "budget": {
                    "type": "number",
                    "description": "Needs the project financials permission."
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/projects/{id}": {
      "get": {
        "operationId": "get_project",
        "summary": "GET /projects/{id}",
        "tags": [
          "projects"
        ],
        "description": "Required scope: projects:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "projects:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "operationId": "update_project",
        "summary": "PATCH /projects/{id}",
        "tags": [
          "projects"
        ],
        "description": "Required scope: projects:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "projects:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "planning",
                      "active",
                      "on_hold",
                      "completed",
                      "cancelled"
                    ]
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "none",
                      "low",
                      "medium",
                      "high",
                      "urgent"
                    ]
                  },
                  "projectType": {
                    "type": "string"
                  },
                  "startDate": {
                    "type": "string",
                    "description": "A date, YYYY-MM-DD. Send null to clear it."
                  },
                  "endDate": {
                    "type": "string",
                    "description": "A date, YYYY-MM-DD. Send null to clear it."
                  },
                  "companyId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "contactId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "dealId": {
                    "type": "string",
                    "description": "Needs deal access.",
                    "format": "uuid"
                  },
                  "ownerUserId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "engagementId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "budget": {
                    "type": "number",
                    "description": "Needs the project financials permission."
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/pipelines": {
      "get": {
        "operationId": "list_pipelines",
        "summary": "GET /pipelines",
        "tags": [
          "pipelines"
        ],
        "description": "Required scope: pipelines:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "pipelines:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/members": {
      "get": {
        "operationId": "list_members",
        "summary": "GET /members",
        "tags": [
          "members"
        ],
        "description": "Required scope: members:read. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "members:read",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tasks/{id}/complete": {
      "post": {
        "operationId": "complete_task",
        "summary": "POST /tasks/{id}/complete",
        "tags": [
          "tasks"
        ],
        "description": "Required scope: tasks:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "tasks:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "done": {
                    "type": "boolean",
                    "description": "Defaults to true."
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/activities/notes": {
      "post": {
        "operationId": "create_note",
        "summary": "POST /activities/notes",
        "tags": [
          "activities"
        ],
        "description": "Required scope: activities:write. Also constrained by the key owner's current workspace role. Detail responses contain only the requested resource, without expanded timelines.",
        "x-required-scope": "activities:write",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "description": "What to record, in the words it should be read in."
                  },
                  "dealId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "contactId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  },
                  "companyId": {
                    "type": "string",
                    "description": "The record's id, as returned by a list or search tool.",
                    "format": "uuid"
                  }
                },
                "required": [
                  "body"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/me": {
      "get": {
        "operationId": "api_me",
        "summary": "Workspace and configured scopes",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "data.workspace and data.scopes; configured scopes can be further limited by the current role."
          },
          "401": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "trl_api_…"
      }
    },
    "responses": {
      "Error": {
        "description": "Error; X-Request-Id identifies the request. 429 includes Retry-After in seconds.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "object",
                  "required": [
                    "code",
                    "message",
                    "requestId"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
