AlmondTill/G3N API

mintNoteAttachmentUpload

mutation · in the family Work and notes

What it does

Get a short-lived, pre-authorized upload slot for a note attachment.

Template class (hand-derived v29).

Before you call

A signed-in user’s session — the call refuses an API key (AUTHZ/FORBIDDEN).

Capability area: Work and notes — Tasks, notes, messages, dashboards and the everyday tools every staff member keeps.

Roles that may call it:

What happens

The file type and size are checked BEFORE any bytes move; risky types are refused unless scanning is enabled for your group.

Arguments

NameTypeRequiredNotes
inputMintNoteAttachmentUploadInput MintNoteAttachmentUploadInput!yesUpload-mint input.

Returns

NoteAttachmentUploadTicket NoteAttachmentUploadTicket! — The upload ticket: a short-TTL presigned PUT against the write-once blob key, pre-tagged pending (the 7-day lifecycle reaps never-attached orphans). Bind the attachmentId via addNote before the TTL's practical window closes.

Example request

graphql
mutation ExampleMintNoteAttachmentUpload($input: MintNoteAttachmentUploadInput!) {
  mintNoteAttachmentUpload(input: $input) {
    attachmentId
    key
    uploadUrl
    expiresAt
  }
}

Variables:

json
{
  "input": {
    "targetConstructId": "01900000-0000-7000-8000-567d5fed0000",
    "targetType": "<target type>",
    "filename": "<filename>",
    "declaredContentType": "<declared content type>",
    "bytes": 1,
    "sha256": "<sha256>"
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "mintNoteAttachmentUpload": {
      "attachmentId": "01900000-0000-7000-8000-9048e2880000",
      "key": "<key>",
      "uploadUrl": "https://example.com/hook",
      "expiresAt": "2028-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in