def set_record(client, domain, selector, data):
    """Creates a new record

    :returns: (int) The id of the created record
    """
    # create a new record
    record = {
        'fieldType': 'TXT',
        'subDomain': selector,
        'target': data,
        'ttl': 60,  # 1 min (minimum allowed by OVH)
    }
    ret = client.post('/domain/zone/%s/record' % domain, **record)
    # refresh the zone
    client.post('/domain/zone/%s/refresh' % domain)
    # return id
    return ret['id']