Raw schema
{
"type": "object",
"properties": {
"session_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The UUID after /s/ in a Keyboardia share URL. Pass only the UUID, not the full URL."
},
"edit": {
"oneOf": [
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "add_track"
},
"track_id": {
"type": "string",
"pattern": "^(?=.{10,64}$)[A-Za-z0-9][A-Za-z0-9._-]*-[0-9a-fA-F]{8,32}$",
"description": "Generate a fresh collision-resistant ID that ends with at least eight hexadecimal characters, such as agent-kick-a7f3c29d. Generate it once and reuse it on retries."
},
"sample_id": {
"type": "string",
"enum": [
"advanced:acid-bass",
"advanced:sub-bass",
"advanced:supersaw",
"advanced:thick-lead",
"advanced:tremolo-strings",
"advanced:vibrato-lead",
"advanced:warm-pad",
"advanced:wobble-bass",
"bass",
"cabasa",
"chord",
"clap",
"clave",
"conga",
"cowbell",
"hihat",
"kick",
"lead",
"noise",
"openhat",
"pad",
"pluck",
"rim",
"sampled:808-clap",
"sampled:808-hihat-closed",
"sampled:808-hihat-open",
"sampled:808-kick",
"sampled:808-snare",
"sampled:acoustic-crash",
"sampled:acoustic-guitar",
"sampled:acoustic-hihat-closed",
"sampled:acoustic-hihat-open",
"sampled:acoustic-kick",
"sampled:acoustic-ride",
"sampled:acoustic-snare",
"sampled:alto-sax",
"sampled:brushes-snare",
"sampled:clean-guitar",
"sampled:finger-bass",
"sampled:french-horn",
"sampled:hammond-organ",
"sampled:kalimba",
"sampled:marimba",
"sampled:piano",
"sampled:slap-bass",
"sampled:steel-drums",
"sampled:string-section",
"sampled:vibraphone",
"sampled:vinyl-crackle",
"shaker",
"snare",
"subbass",
"synth:acid",
"synth:bass",
"synth:bell",
"synth:brass",
"synth:clavinet",
"synth:discobass",
"synth:dreampop",
"synth:epiano",
"synth:evolving",
"synth:funkbass",
"synth:glass",
"synth:growl",
"synth:hoover",
"synth:hypersaw",
"synth:jangle",
"synth:lead",
"synth:organ",
"synth:organphase",
"synth:pad",
"synth:pluck",
"synth:reese",
"synth:rhodes",
"synth:shimmer",
"synth:stab",
"synth:strings",
"synth:sub",
"synth:supersaw",
"synth:sweep",
"synth:vibes",
"synth:warmpad",
"synth:wobble",
"synth:wurlitzer",
"tambourine",
"tom",
"tone:am-bell",
"tone:am-tremolo",
"tone:duo-lead",
"tone:fm-bass",
"tone:fm-bell",
"tone:fm-epiano",
"tone:membrane-kick",
"tone:membrane-tom",
"tone:metal-cymbal",
"tone:metal-hihat",
"tone:pluck-string",
"woodblock",
"zap"
],
"description": "The canonical Keyboardia instrument ID. Use one of the enumerated values exactly."
},
"name": {
"description": "Optional display name. The instrument name is used when omitted.",
"type": "string",
"minLength": 1,
"maxLength": 32
}
},
"required": [
"operation",
"track_id",
"sample_id"
],
"additionalProperties": false,
"description": "Add one track. Retrying the same track_id and definition is a no-op; a conflicting reuse is rejected."
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "set_track_instrument"
},
"track_id": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",
"description": "For add_track, choose a stable unique ID and reuse it on retries. For set_steps or set_track_instrument, copy an existing track_id from get_session."
},
"sample_id": {
"type": "string",
"enum": [
"advanced:acid-bass",
"advanced:sub-bass",
"advanced:supersaw",
"advanced:thick-lead",
"advanced:tremolo-strings",
"advanced:vibrato-lead",
"advanced:warm-pad",
"advanced:wobble-bass",
"bass",
"cabasa",
"chord",
"clap",
"clave",
"conga",
"cowbell",
"hihat",
"kick",
"lead",
"noise",
"openhat",
"pad",
"pluck",
"rim",
"sampled:808-clap",
"sampled:808-hihat-closed",
"sampled:808-hihat-open",
"sampled:808-kick",
"sampled:808-snare",
"sampled:acoustic-crash",
"sampled:acoustic-guitar",
"sampled:acoustic-hihat-closed",
"sampled:acoustic-hihat-open",
"sampled:acoustic-kick",
"sampled:acoustic-ride",
"sampled:acoustic-snare",
"sampled:alto-sax",
"sampled:brushes-snare",
"sampled:clean-guitar",
"sampled:finger-bass",
"sampled:french-horn",
"sampled:hammond-organ",
"sampled:kalimba",
"sampled:marimba",
"sampled:piano",
"sampled:slap-bass",
"sampled:steel-drums",
"sampled:string-section",
"sampled:vibraphone",
"sampled:vinyl-crackle",
"shaker",
"snare",
"subbass",
"synth:acid",
"synth:bass",
"synth:bell",
"synth:brass",
"synth:clavinet",
"synth:discobass",
"synth:dreampop",
"synth:epiano",
"synth:evolving",
"synth:funkbass",
"synth:glass",
"synth:growl",
"synth:hoover",
"synth:hypersaw",
"synth:jangle",
"synth:lead",
"synth:organ",
"synth:organphase",
"synth:pad",
"synth:pluck",
"synth:reese",
"synth:rhodes",
"synth:shimmer",
"synth:stab",
"synth:strings",
"synth:sub",
"synth:supersaw",
"synth:sweep",
"synth:vibes",
"synth:warmpad",
"synth:wobble",
"synth:wurlitzer",
"tambourine",
"tom",
"tone:am-bell",
"tone:am-tremolo",
"tone:duo-lead",
"tone:fm-bass",
"tone:fm-bell",
"tone:fm-epiano",
"tone:membrane-kick",
"tone:membrane-tom",
"tone:metal-cymbal",
"tone:metal-hihat",
"tone:pluck-string",
"woodblock",
"zap"
],
"description": "The canonical Keyboardia instrument ID. Use one of the enumerated values exactly."
}
},
"required": [
"operation",
"track_id",
"sample_id"
],
"additionalProperties": false,
"description": "Replace only an existing track's sound source while preserving its name, pattern, mix, and timing."
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "set_steps"
},
"track_id": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",
"description": "For add_track, choose a stable unique ID and reuse it on retries. For set_steps or set_track_instrument, copy an existing track_id from get_session."
},
"changes": {
"minItems": 1,
"maxItems": 128,
"type": "array",
"items": {
"type": "object",
"properties": {
"step": {
"type": "integer",
"minimum": 0,
"maximum": 127,
"description": "Zero-based step index. It must be within this track's current step_count."
},
"value": {
"type": "boolean",
"description": "true activates the step; false clears it."
}
},
"required": [
"step",
"value"
],
"additionalProperties": false
},
"description": "Assignments for named steps only. Every unmentioned step is preserved."
}
},
"required": [
"operation",
"track_id",
"changes"
],
"additionalProperties": false,
"description": "Change only the listed steps on an existing track. Read get_session first to obtain its track_id and step_count."
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "set_tempo"
},
"tempo": {
"type": "number",
"minimum": 60,
"maximum": 180,
"description": "Session tempo in beats per minute (60-180)."
}
},
"required": [
"operation",
"tempo"
],
"additionalProperties": false,
"description": "Set the session-wide tempo without changing any track."
}
],
"description": "Exactly one narrow session edit."
}
},
"required": [
"session_id",
"edit"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "The target session and one retry-safe edit to apply."
}