{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/firetiger/json-schema/firetiger-post-firetiger-nxagent-v2-agentservice-write-request-schema.json",
  "title": "PostFiretigerNxagentV2AgentserviceWriteRequest",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_ae-authored/firetiger-openapi-generated.yml#/components/schemas/PostFiretigerNxagentV2AgentserviceWriteRequest",
  "type": "object",
  "properties": {
    "session": {
      "type": "string",
      "description": "Resource name of the session to write to (`agents/{agent}/sessions/{session}`). Either `session` or `parent` must be set."
    },
    "parent": {
      "type": "string",
      "description": "Parent agent resource name (`agents/{agent}`). If set (and `session` is empty), a new session is auto-created."
    },
    "messages": {
      "type": "array",
      "description": "Messages to write (must not be empty). Each message is a `google.protobuf.Any` with an `@type` field."
    },
    "write_mode": {
      "type": "string",
      "description": "How to write: `WRITE_MODE_CHECKPOINT` (default, triggers agent), `WRITE_MODE_PROVISIONAL` (queued silently), or `WRITE_MODE_PROVISIONAL_OR_CHECKPOINT` (provisional if agent is running, checkpoint if idle)."
    },
    "artifacts": {
      "type": "array",
      "description": "References (by `sha256`) to artifacts already uploaded via `PUT /v1/artifacts/{sha256}`. Each entry carries `{name, sha256, content_type, content_encoding}`. The server imports each referenced object into the session's artifact namespace under the given `name` before the messages are appended, so attachments arrive atomically with the message. The CAS object must already exist (returns `FailedPrecondition` otherwise). Each artifact is capped at 64 MiB, with a 128 MiB combined per-request cap."
    }
  },
  "required": [
    "messages"
  ]
}