{
  "openapi": "3.1.0",
  "info": {
    "title": "Takibi agent API",
    "version": "1.0.0",
    "description": "The retrieval and task operations used by the Takibi agent CLI. Human workspace administration and billing are outside this contract."
  },
  "servers": [
    {
      "url": "https://app.takibibase.com"
    }
  ],
  "security": [
    {
      "ProfileKey": []
    }
  ],
  "paths": {
    "/v1/ask": {
      "get": {
        "operationId": "ask",
        "summary": "Ask a question",
        "description": "Requires ask capability. Returns verbatim passages and citations; may abstain. Jev failures can fall back to deterministic extraction.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Question to answer from source evidence.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "description": "Project UUID. May be omitted only when the key resolves to a single project.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "folderId",
            "in": "query",
            "required": false,
            "description": "Narrow retrieval to a granted folder.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "k",
            "in": "query",
            "required": false,
            "description": "Candidate count, clamped to 1–12.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskAnswer"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, paused or revoked key, or human-only route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Capability or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or not visible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily budget limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "askPost",
        "summary": "Ask with a JSON body",
        "description": "Same extractive answer contract as GET. Requires ask capability.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskAnswer"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, paused or revoked key, or human-only route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Capability or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or not visible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily budget limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "q": {
                    "type": "string"
                  },
                  "projectId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "folderId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "k": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12,
                    "default": 10
                  }
                },
                "required": [
                  "q"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/search": {
      "get": {
        "operationId": "search",
        "summary": "Search source snippets",
        "description": "Requires search capability. Returns ranked snippets, not full document text.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search query.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "description": "Project UUID. May be omitted only when the key resolves to a single project.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "folderId",
            "in": "query",
            "required": false,
            "description": "Narrow retrieval to a granted folder.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "k",
            "in": "query",
            "required": false,
            "description": "Maximum results, 1–20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SearchHit"
                      }
                    }
                  },
                  "required": [
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, paused or revoked key, or human-only route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Capability or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or not visible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily budget limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents": {
      "get": {
        "operationId": "listDocuments",
        "summary": "List accessible documents",
        "description": "Profile keys see only indexed documents within their grants.",
        "parameters": [
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "description": "Project UUID. May be omitted only when the key resolves to a single project.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "folderId",
            "in": "query",
            "required": false,
            "description": "Narrow retrieval to a granted folder.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "documents": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Document"
                      }
                    }
                  },
                  "required": [
                    "documents"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, paused or revoked key, or human-only route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Capability or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or not visible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily budget limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{id}": {
      "get": {
        "operationId": "getDocument",
        "summary": "Get document metadata",
        "description": "Returns metadata for an accessible indexed document.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "description": "Project UUID. May be omitted only when the key resolves to a single project.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "required": [
                    "document"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, paused or revoked key, or human-only route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Capability or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or not visible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily budget limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{id}/text": {
      "get": {
        "operationId": "getDocumentText",
        "summary": "Read converted text",
        "description": "Returns the converted text within the Profile document grants. Large responses may be truncated.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "description": "Project UUID. May be omitted only when the key resolves to a single project.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string"
                    },
                    "truncated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "text",
                    "truncated"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, paused or revoked key, or human-only route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Capability or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or not visible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily budget limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks": {
      "get": {
        "operationId": "listTasks",
        "summary": "List the project task board",
        "description": "Requires tasks capability. Any grant touching the project provides membership; folder grants do not filter task cards.",
        "parameters": [
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "description": "Project UUID. May be omitted only when the key resolves to a single project.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "includeArchived",
            "in": "query",
            "required": false,
            "description": "Set to 1 to include archived tasks.",
            "schema": {
              "type": "string",
              "enum": [
                "0",
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tasks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Task"
                      }
                    }
                  },
                  "required": [
                    "tasks"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, paused or revoked key, or human-only route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Capability or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or not visible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or daily budget limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/{id}/claim": {
      "post": {
        "operationId": "claimTask",
        "summary": "Claim an available task",
        "description": "Requires a Profile key with tasks capability. Claims an unassigned todo task for that Profile. Repeating your own successful claim is safe.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "description": "Project UUID. May be omitted only when the key resolves to a single project.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "task": {
                      "$ref": "#/components/schemas/Task"
                    }
                  },
                  "required": [
                    "task"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, paused or revoked key, or human-only route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Capability or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or not visible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Task state or ownership conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/{id}": {
      "patch": {
        "operationId": "updateTask",
        "summary": "Update a task",
        "description": "Requires tasks capability. Own-task gates apply. Assignment, archive, and accepting reviewed work require task:assign or a human session.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "description": "Project UUID. May be omitted only when the key resolves to a single project.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "task": {
                      "$ref": "#/components/schemas/Task"
                    }
                  },
                  "required": [
                    "task"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, paused or revoked key, or human-only route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Capability or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or not visible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Task state or ownership conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid assignment or operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  },
                  "body": {
                    "type": "string",
                    "maxLength": 1000000
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "todo",
                      "in_progress",
                      "review",
                      "done"
                    ]
                  },
                  "assigneeProfileId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "blocked": {
                    "type": "boolean"
                  },
                  "blockedReason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 500
                  },
                  "dueAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "archived": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/{id}/artifacts": {
      "post": {
        "operationId": "addTaskArtifact",
        "summary": "Attach an output link",
        "description": "Requires tasks capability and own-task access, or task:assign. Only HTTP(S) links are accepted; this does not upload files.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Resource UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "description": "Project UUID. May be omitted only when the key resolves to a single project.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "artifact": {
                      "$ref": "#/components/schemas/Artifact"
                    }
                  },
                  "required": [
                    "artifact"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, paused or revoked key, or human-only route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Capability or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found or not visible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2000
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "assertedSize": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0
                  },
                  "assertedHash": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 256
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ProfileKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A Profile credential formatted as publicId.secret. All credentials in a Profile share its document grants."
      }
    },
    "schemas": {
      "Span": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "documentName": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "documentId": {
            "type": "string",
            "format": "uuid"
          },
          "chunkId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "text",
          "documentName",
          "title",
          "documentId",
          "chunkId"
        ]
      },
      "Citation": {
        "type": "object",
        "properties": {
          "documentName": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "documentId": {
            "type": "string",
            "format": "uuid"
          },
          "chunkId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "documentId",
          "documentName",
          "chunkId",
          "title"
        ]
      },
      "AskAnswer": {
        "type": "object",
        "properties": {
          "spans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Span"
            }
          },
          "citations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Citation"
            }
          },
          "support": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Versioned evidence support; not confidence."
          },
          "supportVersion": {
            "type": "string"
          },
          "abstained": {
            "type": "boolean"
          },
          "candidateCount": {
            "type": "integer"
          },
          "answerability": {
            "type": "string",
            "enum": [
              "answerable",
              "partial",
              "unanswerable",
              "unknown"
            ]
          },
          "conflict": {
            "type": "boolean"
          }
        },
        "required": [
          "spans",
          "citations",
          "support",
          "supportVersion",
          "abstained",
          "candidateCount",
          "answerability",
          "conflict"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "SearchHit": {
        "type": "object",
        "properties": {
          "chunkId": {
            "type": "string",
            "format": "uuid"
          },
          "documentId": {
            "type": "string",
            "format": "uuid"
          },
          "documentName": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "snippet": {
            "type": "string"
          },
          "rank": {
            "type": "number"
          },
          "documentCreatedAt": {
            "type": "string"
          },
          "ttlDays": {
            "type": "integer"
          }
        }
      },
      "Artifact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "assertedSize": {
            "type": [
              "integer",
              "null"
            ]
          },
          "assertedHash": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdByProfileId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          }
        }
      },
      "Task": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "projectId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "todo",
              "in_progress",
              "review",
              "done"
            ]
          },
          "blocked": {
            "type": "boolean"
          },
          "blockedReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "assigneeProfileId": {
            "type": [
              "string",
              "null"
            ]
          },
          "assigneeName": {
            "type": [
              "string",
              "null"
            ]
          },
          "dueAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "archivedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdByProfileId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "artifacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Artifact"
            }
          }
        }
      },
      "Document": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "folderId": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "bytes": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "ttlDays": {
            "type": "integer"
          },
          "stale": {
            "type": "boolean"
          }
        }
      }
    }
  }
}