DocumentationAPI reference

Rust · 0.1.0

Upload Attachment

POST /api/v1/attachments:upload

AttachmentService · AttachmentService_UploadAttachment

Protocol-derived reference. Authorization and instance policy still apply. Schema descriptions are inherited from the MIT-licensed application contract; examples here are not executed against a live server.

Access

Requires an authenticated, active account. Instance policy and the operation-specific checks below still apply.

Chunk upload sequence

Begin with spec.attachment metadata, spec.totalSize and writeOffset "0". Send file bytes in data, not spec.attachment.content; REST encodes data as base64. Continue with the returned uploadId and committedSize as writeOffset. Each decoded chunk is at most maxChunkSize (currently 2 MiB). Finish with finishWrite: true only when all bytes are committed. An empty non-finishing call reports progress; identical replay of the most recent chunk is supported. Sessions belong to their caller, expire after 30 minutes idle and are lost on restart. Persist the finalized attachment name, not uploadId.

Request

UploadAttachment uploads a file in bounded chunks. The first call carries the spec and returns an upload_id; later calls carry that upload_id. Uploads are bound to the authenticated user, expire after 30 minutes of inactivity, and do not survive a server restart.

POST/api/v1/attachments:upload

Parameters

No path or query parameters are declared.

Request body

Required

application/json · UploadAttachmentRequest

Responses

200 · OK

application/json · UploadAttachmentResponse

default · Default error response

application/json · Status

Complete operation definition

All declared constraints, media types and response details are retained below. Schema references link to their complete definitions.

Open JSON definition
{
  "tags": [
    "AttachmentService"
  ],
  "description": "UploadAttachment uploads a file in bounded chunks. The first call carries\n the spec and returns an upload_id; later calls carry that upload_id.\n Uploads are bound to the authenticated user, expire after 30 minutes of\n inactivity, and do not survive a server restart.",
  "operationId": "AttachmentService_UploadAttachment",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/UploadAttachmentRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/UploadAttachmentResponse"
          }
        }
      }
    },
    "default": {
      "description": "Default error response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Status"
          }
        }
      }
    }
  }
}