# Upload A Document

> Solarium docs, Receipts. All requests are `POST https://api.trysolarium.com/graphql/` with `Authorization: Bearer <api key>` and a JSON body `{"query": ..., "variables": ...}`. Every query and mutation takes an `organizationId` (find it with `myOrganizations`). Index of all pages: https://trysolarium.com/llms.txt

Add a receipt, bill or invoice from a file: PDF, JPEG, PNG, HEIC or WebP, up to 15 MB. It's read like a receipt emailed to Solarium and lands in review as a draft. Previews by default. On the free plan it counts toward the year's receipts, and past them the file is kept and read when the business upgrades. A bank or card statement is sent with kind statement. It's kept as a PDF without being read as a receipt, and it doesn't count toward the free plan.

### Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organizationId` | `UUID!` | Yes | Organization ID |
| `name` | `String!` | Yes | "upload_document" |
| `params.filename` | `String` | No | The file's name, like receipt.pdf. Needed unless you pass gmail_message_id |
| `params.content_base64` | `String` | No | The file's bytes, base64 encoded (or pass url) |
| `params.gmail_message_id` | `String` | No | A message in the business's connected Gmail, instead of a file. Its attachments are added, or with none the email itself as a PDF. Refused when Gmail isn't connected or the message isn't there |
| `params.url` | `String` | No | A public https link to the file. Links to private networks are refused |
| `params.note` | `String` | No | Anything to remember about it, kept on the receipt |
| `params.kind` | `String` | No | receipt (the default) or statement |
| `params.account_id` | `UUID` | No | For a statement, the bank or card it's for |
| `apply` | `Boolean` | No | true to add it |

### Request

```graphql
mutation {
  runOp(
    organizationId: "a1b2c3d4-..."
    name: "upload_document"
    apply: true
    params: { filename: "staples.pdf", url: "https://files.example.com/staples.pdf" }
  ) { success applied result }
}
```

### Response

```json
{
  "data": {
    "runOp": {
      "success": true,
      "applied": true,
      "result": {
        "summary": "Added staples.pdf: Staples 42.50.",
        "data": {
          "filename": "staples.pdf",
          "receipts": [
            { "receipt_id": "c3d4e5f6-...", "vendor": "Staples", "amount": "42.50", "date": "2026-10-28", "status": "draft", "event_id": null }
          ]
        }
      }
    }
  }
}
```
