User:Bitmap/Relationship Editor Parameters

From MusicBrainz Wiki
< User:Bitmap
Revision as of 20:15, 25 May 2014 by JesseW (talk | contribs) (add some additional notes)
Jump to navigationJump to search

This page documents a list of parameters you can POST to the relationship editor to add/edit/remove relationships. The relationships don't have to be on the same release.

Requests are sent to:

You'll receive a JSON response with a "edits" key containing an array (one for each relationship added), each containing a "message" key, whose value will either be "OK", if the edit was added, or "no changes" if it already existed. If there were errors, instead of an "edits" key, the response will contain a "errors" key.


All relationship data is prefixed with rel-editor.rels.n, where n is an integer unique to each relationship.

Boolean values are either "0" or "1".

Must be one of: "edit" (if changing an existing relationship), "add" (if adding a new relationship), or "remove" (if removing a relationship). Required.
The integer ID of the relationship. Required if action is "edit" or "remove".
The integer ID of the relationship type. Required.
The MBID of entity n in the relationship. Required.
n is either "0" or "1". The entities must be in the correct order for their link type (e.g. for an artist-recording relationship, the artist must be entity.0 and the recording must be entity.1). See for a list of relationship types and the direction of their entities.
Must be one of: "artist", "label", "recording", "release", "release_group", or "work". Required.
Integer year/month/day, boolean ended. Optional.
Use the former syntax for boolean attributes (e.g. attrs.additional), and the latter for multi-valued attributes (e.g. attrs.vocal.0, attrs.vocal.1). Optional.

Other data

Specify the contents of an edit note.
Boolean, specifying whether to submit the edits with auto-editor privileges.


In JSON format; NOTE that the POST data should be in url-encoded format, instead.

    "rel-editor.rels.0.action":           "edit",
    "rel-editor.rels.0.attrs.additional": 0,
    "rel-editor.rels.0.attrs.translated": 0,
    "rel-editor.rels.0.entity.0.gid":     "ba550d0e-adac-4864-b88b-407cab5e76af",
    "rel-editor.rels.0.entity.0.type":    "artist",
    "rel-editor.rels.0.entity.1.gid":     "a8a158e3-0a0e-37e1-b5b5-9480a02d816e",
    "rel-editor.rels.0.entity.1.type":    "work",
    "":               15929,
    "rel-editor.rels.0.link_type":        169,
    "rel-editor.edit_note":               "removing all of the attributes because reasons",
    "rel-editor.as_auto_editor":          0