DocumentationAPI reference

Rust · 0.1.0

Create Attachment

POST /api/v1/attachments

AttachmentService · AttachmentService_CreateAttachment

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.

Upload bytes in JSON

Send Attachment directly, with filename, MIME type and base64 content. The optional memo field is a full memo resource name and requires permission to manage that memo. The default upload size limit is 32 MiB unless storage settings change it. Creation returns metadata; content is input-only. The immediate response may omit the memo backlink even when linkage succeeded, so GetAttachment can be used to read the final projection.

Request

CreateAttachment creates a new attachment.

POST/api/v1/attachments

Parameters

Name / locationType / requirementDescription
attachmentId
query
string
Not marked required in OpenAPI
Optional. The attachment ID to use for this attachment. If empty, a unique ID will be generated. Format: ^[a-zA-Z0-9]([a-zA-Z0-9-]{0,34}[a-zA-Z0-9])?$

Request body

Required

application/json · Attachment

Responses

200 · OK

application/json · Attachment

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": "CreateAttachment creates a new attachment.",
  "operationId": "AttachmentService_CreateAttachment",
  "parameters": [
    {
      "name": "attachmentId",
      "in": "query",
      "description": "Optional. The attachment ID to use for this attachment.\n If empty, a unique ID will be generated.\n Format: ^[a-zA-Z0-9]([a-zA-Z0-9-]{0,34}[a-zA-Z0-9])?$",
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Attachment"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Attachment"
          }
        }
      }
    },
    "default": {
      "description": "Default error response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Status"
          }
        }
      }
    }
  }
}