@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Up API
@base https://api.up.com.au/api/v1
@version v1
@auth Bearer bearer
@endpoints 20
@toc accounts(3), attachments(2), categories(2), transactions(5), util(1), tags(1), webhooks(6)

@group accounts
@endpoint GET /accounts
@optional {page[size]: int, filter[accountType]: any, filter[ownershipType]: any}
@returns(200) {data: [map], links: map{prev: str?, next: str?}}

@endpoint GET /accounts/{id}
@required {id: str}
@returns(200) {data: any}

@endgroup

@group attachments
@endpoint GET /attachments
@returns(200) {data: [map], links: map{prev: str?, next: str?}}

@endpoint GET /attachments/{id}
@required {id: str}
@returns(200) {data: any}

@endgroup

@group categories
@endpoint GET /categories
@optional {filter[parent]: str}
@returns(200) {data: [map]}

@endpoint GET /categories/{id}
@required {id: str}
@returns(200) {data: any}

@endgroup

@group transactions
@endpoint PATCH /transactions/{transactionId}/relationships/category
@required {transactionId: str, data: any}
@returns(204)

@endgroup

@group util
@endpoint GET /util/ping
@returns(200) {meta: map{id: str, statusEmoji: str}}
@errors {401}

@endgroup

@group tags
@endpoint GET /tags
@optional {page[size]: int}
@returns(200) {data: [map], links: map{prev: str?, next: str?}}

@endgroup

@group transactions
@endpoint POST /transactions/{transactionId}/relationships/tags
@required {transactionId: str, data: [map{type!: str, id!: str}]}
@returns(204)

@endpoint DELETE /transactions/{transactionId}/relationships/tags
@required {transactionId: str, data: [map{type!: str, id!: str}]}
@returns(204)

@endpoint GET /transactions
@optional {page[size]: int, filter[status]: any, filter[since]: str(date-time), filter[until]: str(date-time), filter[category]: str, filter[tag]: str}
@returns(200) {data: [map], links: map{prev: str?, next: str?}}

@endpoint GET /transactions/{id}
@required {id: str}
@returns(200) {data: any}

@endgroup

@group accounts
@endpoint GET /accounts/{accountId}/transactions
@required {accountId: str}
@optional {page[size]: int, filter[status]: any, filter[since]: str(date-time), filter[until]: str(date-time), filter[category]: str, filter[tag]: str}
@returns(200) {data: [map], links: map{prev: str?, next: str?}}

@endgroup

@group webhooks
@endpoint GET /webhooks
@optional {page[size]: int}
@returns(200) {data: [map], links: map{prev: str?, next: str?}}

@endpoint POST /webhooks
@required {data: any}
@returns(201) {data: any}

@endpoint GET /webhooks/{id}
@required {id: str}
@returns(200) {data: any}

@endpoint DELETE /webhooks/{id}
@required {id: str}
@returns(204)

@endpoint POST /webhooks/{webhookId}/ping
@required {webhookId: str}
@returns(201) {data: any}

@endpoint GET /webhooks/{webhookId}/logs
@required {webhookId: str}
@optional {page[size]: int}
@returns(200) {data: [map], links: map{prev: str?, next: str?}}

@endgroup

@end
