---
updatedAt: 2025-08-27T15:59:04.000Z
agentTools:
  projectIndex: https://docs.moneyhubenterprise.com/v2.5/llms.txt
---

# Add an attachment to a transaction

Requires **transactions:read:all** and either of **transactions:write** or **transactions:write:all** scopes.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "Documentation for the Moneyhub data API. <br/>Authentication is via bearer token. <br/>",
    "title": "Moneyhub Data API",
    "version": "2.0.0"
  },
  "security": [
    {
      "Bearer": []
    }
  ],
  "paths": {
    "/transactions/{transactionId}/files": {
      "post": {
        "summary": "Add an attachment to a transaction",
        "description": "Requires **transactions:read:all** and either of **transactions:write** or **transactions:write:all** scopes.",
        "parameters": [
          {
            "description": "The transaction id",
            "in": "path",
            "name": "transactionId",
            "required": true,
            "example": "0b4e6488-6de0-420c-8f56-fee665707d57",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "description": "File to upload, limit of 10MB and must be an image or PDF.",
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Transaction Response",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TransactionFile"
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unsuccessful Response - Not authorised - Missing authorization header - Invalid access Token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Unsuccessful Response - Forbidden - Invalid scopes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unsuccessful Response - Resource Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "transactions"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.moneyhub.co.uk/v2.0"
    }
  ],
  "components": {
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    },
    "schemas": {
      "TransactionFile": {
        "additionalProperties": false,
        "type": "object",
        "properties": {
          "id": {
            "description": "The id of the file attached to the transaction",
            "example": "c390a94f-2309-4cdf-8d02-b0c5304d9f66",
            "type": "string"
          },
          "fileType": {
            "description": "The MIME type of the file",
            "example": "text/html",
            "type": "string"
          },
          "fileName": {
            "description": "The name of the file attachment",
            "example": "receipt.png",
            "type": "string"
          },
          "url": {
            "description": "The signed URL that is valid for 5 minutes that allows access to the attachment",
            "example": "https://s3.amazon.com/receipt.png",
            "type": "string"
          }
        },
        "required": [
          "id",
          "fileType",
          "fileName",
          "url"
        ]
      },
      "Links": {
        "additionalProperties": false,
        "properties": {
          "next": {
            "description": "The url to retrieve the next page of results from",
            "format": "uri",
            "type": "string"
          },
          "prev": {
            "description": "The url to retrieve the previous page of results from",
            "format": "uri",
            "type": "string"
          },
          "self": {
            "description": "The url of the current resource(s)",
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "self"
        ],
        "type": "object"
      },
      "Error": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "description": "The error code",
            "type": "string"
          },
          "message": {
            "description": "The error message",
            "type": "string"
          },
          "correlationId": {
            "description": "Id that identifies the request and can be used to ask for more details related to the error",
            "type": "string"
          },
          "id": {
            "description": "Id of the resource",
            "type": "string"
          },
          "userId": {
            "description": "UserId of the resource",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```