Developers

The SysexDB API

An HTTP API for MIDI software (librarians, editors, MIDI monitors). Without a user, an app reads the catalog: manufacturers with their MIDI Manufacturer ID, devices, and the public SysEx files with an analysis of their bytes. With the user's permission it also lists the user's own files, private ones included, and downloads SysEx files.

The first version of the API is online. Addresses under /api/v1 do not change in an incompatible way: fields can be added, not removed. Tell us what you are building, and what you miss.

Specification

Everything lives under https://www.sysexdb.com/api/v1. The OpenAPI description is generated from the server code: read it at https://www.sysexdb.com/api/v1/openapi.yaml, or in the public repository on GitHub, where issues and pull requests are welcome.

Example client, with source code

SyxLibEd.Next is a small Windows program that uses this API exactly as any external app would: it signs in with the device flow, searches the catalog, lists and downloads SysEx files and sends them to a MIDI port. Its source code is public under the MIT licence: read how each call is made, or copy the parts you need.

Get a client ID

Every app has its own client ID, assigned by the staff. Ask for one through the contact form or by email at info@sysexdb.com, and state clearly:

A client ID is not issued to unknown projects or to requests without a specific project: we need to be able to see what the program is before registering it.

If the app opens the browser and receives the answer on a local port, add its redirect URIs (for example http://127.0.0.1:7890/callback). You get a client ID such as my-librarian. There is no client secret: desktop and command-line apps could not keep it.

Read the catalog

Calls without a user identify the app with a header:

curl -H "SysexDB-Client-Id: my-librarian" https://www.sysexdb.com/api/v1/devices?q=dx7

Act for a user

With OAuth 2.0. The user approves the app on SysexDB; the app never sees the user's password. Desktop and command-line apps should use the device flow:

  1. POST https://www.sysexdb.com/connect/device with client_id and scope (for example profile sysex.read).
  2. Show the user the user_code and the address https://www.sysexdb.com/activate.
  3. Poll POST https://www.sysexdb.com/connect/token with grant_type=urn:ietf:params:oauth:grant-type:device_code, the device_code and the client_id, every few seconds, until the user has approved.
  4. Call the API with Authorization: Bearer <access token>.

Apps that open the browser can use the authorization code flow with PKCE (S256) at https://www.sysexdb.com/connect/authorize. Access tokens last one hour; the refresh token lasts 90 days and changes at every use. Revoke tokens with POST https://www.sysexdb.com/connect/revoke when the user logs out of your app.

ScopeAllows
profileSee your user name and profile page
sysex.readList and download your SysEx files, including private ones
sysex.writeUpload SysEx files for you, public or private, and edit, publish or delete the ones you uploaded. Descriptions you write through the app are published under CC BY-SA 4.0

Users see the apps they connected, and disconnect them, on their Connected apps page. Changing the password disconnects every app.

Upload for a user

With sysex.write an app uploads, edits, publishes and deletes the files of its user, with the rules of the website. Uploads are multipart/form-data to POST https://www.sysexdb.com/api/v1/sysex; the answer has the analysis of the bytes, so you can warn the user when the Manufacturer ID does not match the device. A private file needs privateStorageTermsAccepted=true: show the user that the private storage is not a backup and that they should keep their own copy. A public file cannot become private again: to withdraw it, delete it. The staff sees which app uploaded each file.

Files can be .syx or Standard MIDI Files (.mid) with only SysEx messages and meta events. A MIDI file is kept and downloaded as uploaded, and its fileFormat is mid; add ?format=syx to the download to get only its SysEx messages.

Limits

Past a limit the answer is 429 with a Retry-After header. Errors are Problem Details (RFC 9457). Please cache what does not change often, such as manufacturers and message types.

Terms and licence

Using the API means accepting the API terms of use. The data licence says what you may do with the data: the catalog is CC0, and every SysEx description says its own licence.

An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.