Attachments
Files — invoice, contract, receipt — uploaded once and linked to one or more bills. links is what creates and undoes that link.
| Command | HTTP | Description |
|---|---|---|
attachments list | GET /v1/attachments | List attachments |
attachments create | POST /v1/attachments | Upload an attachment |
attachments get | GET /v1/attachments/{id} | Get an attachment's metadata by ID |
attachments delete | DELETE /v1/attachments/{id} | Delete an attachment |
attachments download | GET /v1/attachments/{id}/download | Download the attachment's bytes |
attachments links create | POST /v1/attachments/{id}/links | Link an attachment to a record |
attachments links delete | DELETE /v1/attachments/{id}/links | Unlink an attachment from a record |
Examples
--params carries query and path parameters (id, page, filters); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.
# List attachments
kobana finance attachments list \
--fields "id,file_name,title,mime_type,file_size"
# Get an attachment's metadata by ID
kobana finance attachments get --params '{"id": "ATTACHMENT_ID"}'
# Upload an attachment
kobana finance attachments create
# Delete an attachment
kobana finance attachments delete --params '{"id": "ATTACHMENT_ID"}' --dry-run
Next steps
- Receipts
- Schema introspection — every parameter this resource accepts.