def METHOD_NAME(self, request, data):
    """Creates a new job."""
    type_name = data.pop("type")
    job_type = job_type_registry.get(type_name)
    # Because each type can raise custom exceptions while creating the
    # job we need to be able to map those to the correct API exceptions which are
    # defined in the type.
    with job_type.map_api_exceptions():
        job = JobHandler().create_and_start_job(request.user, type_name, **data)
    serializer = job_type.get_serializer(
        job,
        JobSerializer,
        context={"request": request},
    )
    return Response(serializer.data)