def reset_keys(request):
    '''
        POST endpoint to reset API keys for a given API
        (triggering a request for new keys)
    '''
    api_obj = get_object_or_404(Api, name=request.POST['api'])

    # check the signature
    if get_signature(request.POST, api_obj.signing_key) != request.POST['signature']:
        return HttpResponseBadRequest('bad signature')

    ReplicatedApiNames = getattr(settings, 'LOCKSMITH_REPLICATED_APIS', [])
    if api_obj.name in ReplicatedApiNames:
        for key in Key.objects.all():
            replicate_key.delay(key, api_obj)
    else:
        api_obj.pub_statuses.update(status=UNPUBLISHED)
        for key in Key.objects.all():
            push_key.delay(key, replicate_too=False)

    return HttpResponse('OK')