Skip to main content

Attachments

Files — invoice, contract, receipt — uploaded once and linked to one or more bills. links is what creates and undoes that link.

CommandHTTPDescription
attachments listGET /v1/attachmentsList attachments
attachments createPOST /v1/attachmentsUpload an attachment
attachments getGET /v1/attachments/{id}Get an attachment's metadata by ID
attachments deleteDELETE /v1/attachments/{id}Delete an attachment
attachments downloadGET /v1/attachments/{id}/downloadDownload the attachment's bytes
attachments links createPOST /v1/attachments/{id}/linksLink an attachment to a record
attachments links deleteDELETE /v1/attachments/{id}/linksUnlink 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​