Files

File storage.

6 actions. Each is callable by the agent as a tool, over HTTP via /api/invoke, and (usually) from a UI page.

files.list

GET

List uploaded files, optionally scoped to an owner (subject, mission, etc.).

  • AI tool: files_list
  • API: GET /api/invoke/files.list

Input

Field Type Required Description
ownerType string
ownerId string
limit integer
offset integer
orderBy string
orderDir "asc" | "desc"
q string
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ownerType": {
      "type": "string"
    },
    "ownerId": {
      "type": "string",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 500
    },
    "offset": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "orderBy": {
      "type": "string"
    },
    "orderDir": {
      "type": "string",
      "enum": [
        "asc",
        "desc"
      ]
    },
    "q": {
      "type": "string"
    }
  }
}

files.get

GET

Get one file row by id.

  • AI tool: files_get
  • API: GET /api/invoke/files.get

Input

Field Type Required Description
id string yes
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "id"
  ]
}

files.update

PATCH · mutating

Rename a file or reassign its owner.

  • AI tool: files_update
  • API: PATCH /api/invoke/files.update

Input

Field Type Required Description
id string yes
patch object yes
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "patch": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "ownerType": {
          "type": "string"
        },
        "ownerId": {
          "type": "string",
          "minLength": 1
        }
      }
    }
  },
  "required": [
    "id",
    "patch"
  ]
}

files.upload_url

POST · mutating

LLM-callable upload. Either pass bodyBase64 with the bytes inline, OR pass a url to fetch server-side. The agent uses this when generating an image, exporting a transcript, or pulling a remote asset.

When the agent calls it: Use this when you generate or fetch an asset (image, transcript, exported file) and need it stored in the workspace.

  • AI tool: files_upload_url
  • API: POST /api/invoke/files.upload_url

Input

Field Type Required Description
name string yes
contentType string
bodyBase64 string
url string
ownerType string
ownerId string
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "contentType": {
      "type": "string"
    },
    "bodyBase64": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "ownerType": {
      "type": "string"
    },
    "ownerId": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "name"
  ]
}

files.delete

DELETE · mutating

Delete a file from blob storage and remove its database row.

  • AI tool: files_delete
  • API: DELETE /api/invoke/files.delete

Input

Field Type Required Description
id string yes
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "id"
  ]
}

files.ingest_into_knowledge

POST · mutating

Convert an uploaded file into a knowledge source. Creates a knowledge_sources row pointing at the file's URL and queues the ingest pipeline.

  • AI tool: files_ingest_into_knowledge
  • API: POST /api/invoke/files.ingest_into_knowledge

Input

Field Type Required Description
id string yes
subjectId string yes
missionId string
type "github" | "url" | "rss" | "social-profile" | "pdf" | "document" | "transcript" | "video" | "audio"
name string
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "subjectId": {
      "type": "string",
      "minLength": 1
    },
    "missionId": {
      "type": "string",
      "minLength": 1
    },
    "type": {
      "type": "string",
      "enum": [
        "github",
        "url",
        "rss",
        "social-profile",
        "pdf",
        "document",
        "transcript",
        "video",
        "audio"
      ]
    },
    "name": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "subjectId"
  ]
}