attachments

Store a new attachment.

Creates a new attachment. The data required can be submitted as a JSON body or as a list of parameters. You cannot use this endpoint to upload the actual file data (see below). This endpoint only creates the attachment object.

post/v1/attachments

Request

  • Base URL
    https://demo.firefly-iii.org/api
  • URL
    https://demo.firefly-iii.org/api/v1/attachments
  • Auth
    • OAuth 2
      Authorization code: https://demo.firefly-iii.org/oauth/authorize
      Token URL: https://demo.firefly-iii.org/oauth/token
    • or HTTP bearer

Headers

X-Trace-Idstring uuid
Example:40c71bbb-c676-4f24-83cf-cc725d7d7a00

Unique identifier associated with this request.

Request body

filenamestring string required
attachable_type'Account' | 'Budget' | 'Bill' | 'TransactionJournal' | 'PiggyBank' | 'Tag' string required

The object class to which the attachment must be linked.

attachable_idstring string required

ID of the model this attachment is linked to.

titlestring string
notesstring string nullable

Example request

{
  "filename": "file.pdf",
  "attachable_type": "Bill",
  "attachable_id": "134",
  "title": "Some PDF file",
  "notes": "Some notes"
}

Response

New attachment stored, result in response.

Example response

{
  "data": {
    "type": "attachments",
    "id": "2",
    "attributes": {
      "created_at": "2025-11-01T00:00:00+00:00",
      "updated_at": "2025-11-01T00:00:00+00:00",
      "attachable_type": "Bill",
      "attachable_id": "134",
      "hash": "0c3f95f34370baa88f9fd9a671fea305",
      "filename": "file.pdf",
      "download_url": "https://demo.firefly-iii.org/api/v1/attachments/191/download",
      "upload_url": "https://demo.firefly-iii.org/api/v1/attachments/191/download",
      "title": "Some PDF file",
      "notes": "Some notes",
      "mime": "application/pdf",
      "size": 48211
    },
    "links": {
      "0": {
        "rel": "self",
        "uri": "/OBJECTS/1"
      },
      "self": "https://demo.firefly-iii.org/api/v1/OBJECTS/1"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.