'PUT /api/visualizations/{encoded_visualization_id}'

@expose_api
def update(self, trans, id, payload, **kwargs):

    rval = None
    payload = self._validate_and_parse_payload(payload)
    visualization = self.get_visualization(trans, id, check_ownership=True)
    title = payload.get('title', visualization.latest_revision.title)
    dbkey = payload.get('dbkey', visualization.latest_revision.dbkey)
    config = payload.get('config', visualization.latest_revision.config)
    latest_config = visualization.latest_revision.config
    if ((title != visualization.latest_revision.title) or (dbkey != visualization.latest_revision.dbkey) or (json.dumps(config) != json.dumps(latest_config))):
        revision = self.add_visualization_revision(trans, visualization, config, title, dbkey)
        rval = {'id': id, 'revision': revision.id}
    visualization.title = title
    trans.sa_session.flush()
    return rval
