Newer
Older
info:
description: "Documentation for [Funkwhale](https://funkwhale.audio) API. The API is **not** stable yet."
version: "1.0.0"
title: "Funkwhale API"
servers:
- url: https://demo.funkwhale.audio/api/v1
description: Demo server
- url: https://{domain}/api/v1
description: Custom server
variables:
domain:
default: yourdomain
description: Your Funkwhale Domain
protocol:
enum:
- 'http'
- 'https'
default: 'https'
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
components:
securitySchemes:
jwt:
type: http
scheme: bearer
bearerFormat: JWT
description: "You can get a token by using the /token endpoint"
security:
- jwt: []
paths:
/token/:
post:
tags:
- "auth"
description:
Obtain a JWT token you can use for authenticating your next requests.
security: []
responses:
'200':
description: Successfull auth
'400':
description: Invalid credentials
requestBody:
required: true
content:
application/json:
schema:
type: "object"
properties:
username:
type: "string"
example: "demo"
password:
type: "string"
example: "demo"
/artists/:
get:
tags:
- "artists"
parameters:
- name: "q"
in: "query"
description: "Search query used to filter artists"
schema:
required: false
type: "string"
example: "carpenter"
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
- allOf:
- $ref: "#/parameters/Ordering"
- default: "-creation_date"
schema:
required: false
type: "string"
example: "creation_date"
enum:
- creation_date
- id
- name
- $ref: "#/parameters/Playable"
- $ref: "#/parameters/PageNumber"
- $ref: "#/parameters/PageSize"
responses:
200:
content:
application/json:
schema:
allOf:
- $ref: "#/definitions/ResultPage"
- type: "object"
properties:
results:
type: "array"
items:
$ref: "#/definitions/Artist"
/artists/{id}/:
get:
summary: Retrieve a single artist
parameters:
- $ref: "#/parameters/ObjectId"
tags:
- "artists"
responses:
200:
content:
application/json:
schema:
$ref: "#/definitions/Artist"
404:
content:
application/json:
schema:
$ref: "#/definitions/ResourceNotFound"
/artists/{id}/libraries/:
get:
summary: List available user libraries containing work from this artist
parameters:
- $ref: "#/parameters/ObjectId"
- $ref: "#/parameters/PageNumber"
- $ref: "#/parameters/PageSize"
tags:
- "artists"
- "libraries"
responses:
200:
content:
application/json:
schema:
$ref: "#/definitions/LibraryPage"
404:
content:
application/json:
schema:
$ref: "#/definitions/ResourceNotFound"
/albums/:
get:
summary: List albums
tags:
- "albums"
parameters:
- name: "q"
in: "query"
default: null
description: "Search query used to filter albums"
schema:
required: false
type: "string"
example: "carpenter"
- name: "artist"
in: "query"
default: null
description: "Only include albums by the requested artist"
schema:
required: false
type: "integer"
format: "int64"
- allOf:
- $ref: "#/parameters/Ordering"
- default: "-creation_date"
schema:
required: false
type: "string"
example: "creation_date"
enum:
- creation_date
- release_date
- title
- $ref: "#/parameters/Playable"
- $ref: "#/parameters/PageNumber"
- $ref: "#/parameters/PageSize"
responses:
200:
content:
application/json:
schema:
allOf:
- $ref: "#/definitions/ResultPage"
- type: "object"
properties:
results:
type: "array"
items:
$ref: "#/definitions/Album"
/albums/{id}/:
get:
summary: Retrieve a single album
parameters:
- $ref: "#/parameters/ObjectId"
tags:
- "albums"
responses:
200:
content:
application/json:
schema:
$ref: "#/definitions/Album"
404:
content:
application/json:
schema:
$ref: "#/definitions/ResourceNotFound"
/albums/{id}/libraries/:
get:
summary: List available user libraries containing tracks from this album
parameters:
- $ref: "#/parameters/ObjectId"
- $ref: "#/parameters/PageNumber"
- $ref: "#/parameters/PageSize"
tags:
- "albums"
- "libraries"
responses:
200:
content:
application/json:
schema:
$ref: "#/definitions/LibraryPage"
404:
content:
application/json:
schema:
$ref: "#/definitions/ResourceNotFound"
/tracks/:
get:
summary: List tracks
tags:
- "tracks"
parameters:
- name: "q"
in: "query"
default: null
description: "Search query used to filter tracks"
schema:
required: false
type: "string"
example: "carpenter"
- name: "artist"
in: "query"
default: null
description: "Only include tracks by the requested artist"
schema:
required: false
type: "integer"
format: "int64"
- name: "album"
in: "query"
default: null
description: "Only include tracks from the requested album"
schema:
required: false
type: "integer"
format: "int64"
- name: "license"
description: "Only include tracks with the given license"
default: null
type: "string"
- allOf:
- $ref: "#/parameters/Ordering"
- default: "-creation_date"
schema:
required: false
type: "string"
example: "creation_date"
enum:
- creation_date
- release_date
- title
- $ref: "#/parameters/Playable"
- $ref: "#/parameters/PageNumber"
- $ref: "#/parameters/PageSize"
responses:
200:
content:
application/json:
schema:
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
allOf:
- $ref: "#/definitions/ResultPage"
- type: "object"
properties:
results:
type: "array"
items:
$ref: "#/definitions/Track"
/tracks/{id}/:
get:
summary: Retrieve a single track
parameters:
- $ref: "#/parameters/ObjectId"
tags:
- "tracks"
responses:
200:
content:
application/json:
schema:
$ref: "#/definitions/Track"
404:
content:
application/json:
schema:
$ref: "#/definitions/ResourceNotFound"
/tracks/{id}/libraries/:
get:
summary: List available user libraries containing given track
parameters:
- $ref: "#/parameters/ObjectId"
- $ref: "#/parameters/PageNumber"
- $ref: "#/parameters/PageSize"
tags:
- "tracks"
- "libraries"
responses:
200:
content:
application/json:
schema:
$ref: "#/definitions/LibraryPage"
404:
content:
application/json:
schema:
$ref: "#/definitions/ResourceNotFound"
/licenses/:
get:
summary: List licenses
tags:
- "licenses"
parameters:
- $ref: "#/parameters/PageNumber"
- $ref: "#/parameters/PageSize"
responses:
200:
content:
application/json:
schema:
allOf:
- $ref: "#/definitions/ResultPage"
- type: "object"
properties:
results:
type: "array"
items:
$ref: "#/definitions/License"
/licenses/{code}/:
get:
summary: Retrieve a single license
parameters:
- name: code
in: path
description: License code
required: true
schema:
type: string
example: cc0-1.0
tags:
- "licenses"
responses:
200:
content:
application/json:
schema:
$ref: "#/definitions/License"
404:
content:
application/json:
schema:
$ref: "#/definitions/ResourceNotFound"
parameters:
ObjectId:
name: id
in: path
description: Object ID
required: true
schema:
type: integer
format: int64
Ordering:
name: "ordering"
in: "query"
description: "Ordering for the results, prefix with - for DESC ordering"
PageNumber:
in: query
name: page
schema:
type: "integer"
format: "int64"
example: 1
default: 1
minimum: 1
PageSize:
in: query
name: page_size
schema:
type: "integer"
format: "int64"
example: 16
default: 25
minimum: 1
maximum: 25
Playable:
name: "playable"
in: "query"
default: null
description: "Filter/exclude resources with playable tracks"
schema:
required: false
type: "boolean"
mbid:
type: "string"
formats: "uuid"
description: "A musicbrainz ID"
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
ResultPage:
type: "object"
properties:
count:
type: "integer"
format: "int64"
example: 42
description: "The total number of results (all pages included)"
next:
type: "string"
format: "uri"
description: "Link to the next page of results"
previous:
type: "string"
format: "uri"
description: "Link to the previous page of results"
Image:
type: "object"
properties:
original:
type: "string"
description: "URL to the original image"
example: "https://mydomain/media/albums/covers/ec2c53aeaac6.jpg"
small_square_crop:
type: "string"
description: "URL to a small, squared thumbnail of the image"
example: "https://mydomain/media/__sized__/albums/covers/ec2c53aeaac6-crop-c0-5__0-5-50x50-70.jpg"
medium_square_crop:
type: "string"
description: "URL to a medium, squared thumbnail of the image"
example: "https://mydomain/media/__sized__/albums/covers/ec2c53aeaac6-crop-c0-5__0-5-200x200-70.jpg"
square_crop:
type: "string"
description: "URL to a large, squared thumbnail of the image"
example: "https://mydomain/media/__sized__/albums/covers/ec2c53aeaac6-crop-c0-5__0-5-400x400-70.jpg"
Actor:
type: object
description: "A federation/ ActivityPub actor"
properties:
fid:
type: string
format: uri
description: "The actor Federation ID (unique accross federation)"
uuid:
type: string
format: uuid
description: "Local ID of the library"
creation_date:
type: "string"
format: "date-time"
preferred_username:
type: "string"
example: "alice"
name:
type: string
example: "Alice Unicorn"
last_fetch_date:
type: "string"
format: "date-time"
description: "Last time the actor profile was fetched on its origin server"
domain:
type: "string"
format: "hostname"
example: "open.audio"
type:
type: "string"
example: "Person"
enum:
- Person
- Application
- Group
- Organization
manually_approves_followers:
type: "boolean"
full_username:
type: string
example: "alice@open.audio"
BaseArtist:
type: "object"
properties:
mbid:
required: false
$ref: "#/properties/mbid"
id:
type: "integer"
format: "int64"
example: 42
name:
type: "string"
example: "System of a Down"
creation_date:
type: "string"
format: "date-time"
- type: "object"
properties:
albums:
type: "array"
items:
$ref: "#/definitions/ArtistAlbum"
type: "object"
properties:
mbid:
required: false
$ref: "#/properties/mbid"
id:
type: "integer"
format: "int64"
example: 16
artist:
type: "integer"
format: "int64"
example: 42
title:
type: "string"
example: "Toxicity"
creation_date:
type: "string"
format: "date-time"
release_date:
type: "string"
required: false
format: "date"
example: "2001-01-01"
is_playable:
type: "boolean"
cover:
$ref: "#/definitions/Image"
Album:
type: "object"
allOf:
- $ref: "#/definitions/BaseAlbum"
- type: "object"
properties:
tracks:
type: "array"
items:
$ref: "#/definitions/AlbumTrack"
tracks_count:
type: "integer"
format: "int64"
example: 16
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
Library:
type: "object"
properties:
fid:
type: string
format: uri
description: "The library Federation ID (unique accross federation)"
uuid:
type: string
format: uuid
description: "Local ID of the library"
name:
type: string
example: "My awesome library"
description:
type: string
nullable: true
example: "This library contains all the stuff I love!"
uploads_count:
type: "integer"
format: "int64"
example: 687
privacy_level:
type: string
example: "me"
enum:
- "me"
- "instance"
- "everyone"
actor:
$ref: "#/definitions/Actor"
LibraryPage:
allOf:
- $ref: "#/definitions/ResultPage"
- type: "object"
properties:
results:
type: "array"
items:
$ref: "#/definitions/Library"
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
License:
type: "object"
properties:
id:
type: string
format: uri
example: http://creativecommons.org/publicdomain/zero/1.0/
description: "The license ID"
url:
type: string
format: uri
example: http://creativecommons.org/publicdomain/zero/1.0/
description: "The license url (can be different than the ID)"
code:
type: string
description: "A unique code to identify the license"
example: cc0-1.0
redistribute:
type: boolean
example: true
description: "Does the license allow free redistribution?"
derivative:
type: boolean
example: true
description: "Does the license allow the creation of derivative work?"
commercial:
type: boolean
example: true
description: "Does the license allow commercial use?"
attribution:
type: boolean
example: false
description: "Does the license requires crediting the author?"
copyleft:
type: boolean
example: false
description: "Does the license enforce a similar license of derivative work?"
BaseTrack:
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
type: "object"
properties:
mbid:
required: false
$ref: "#/properties/mbid"
id:
type: "integer"
format: "int64"
example: 66
artist:
type: "integer"
format: "int64"
example: 42
album:
type: "integer"
format: "int64"
example: 16
title:
type: "string"
example: "Chop Suey!"
position:
required: false
description: "Position of the track in the album"
type: "number"
minimum: 1
example: 1
disc_number:
required: false
type: "number"
minimum: 1
example: 1
listen_url:
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
format: "uri"
description: "URL to stream the track"
copyright:
type: "string"
example: "Creative Commons Attribution-NonCommercial-NoDerivatives 4.0: http://creativecommons.org/licenses/by-nc-nd/4.0/"
description: "Copyright information as extracted from upload tags"
license:
type: "string"
description: "Identifier of the license that is linked to the track"
example: "cc-by-nc-nd-4.0"
AlbumTrack:
type: "object"
allOf:
- $ref: "#/definitions/BaseTrack"
- type: "object"
properties:
artist:
$ref: "#/definitions/BaseArtist"
uploads:
type: "array"
description: "List of uploads associated with this track"
items:
$ref: "#/definitions/Upload"
Track:
type: "object"
allOf:
- $ref: "#/definitions/BaseTrack"
- type: "object"
properties:
album:
$ref: "#/definitions/Album"
artist:
$ref: "#/definitions/BaseArtist"
uploads:
type: "array"
description: "List of uploads associated with this track"
items:
$ref: "#/definitions/Upload"
Upload:
type: "object"
properties:
uuid:
type: string
format: uuid
size:
type: "integer"
format: "int64"
example: 278987000
description: "Size of the file, in bytes"
duration:
type: "integer"
format: "int64"
example: 184
description: "Duration of the audio, in seconds"
bitrate:
type: "integer"
format: "int64"
example: 128000
description: "Bitrate of the file, in bytes/s"
mimetype:
type: string
example: "audio/ogg"
enum:
- "audio/ogg"
- "audio/mpeg"
- "audio/x-flac"
- "audio/flac"
extension:
type: string
example: "ogg"
description: "File extension of the upload"
listen_url:
type: "string"
format: "uri"
description: "URL to stream the upload"
ResourceNotFound:
type: "object"
properties:
detail:
type: "string"
example: "Not found."