def METHOD_NAME() -> Response:
    try:
        plan = common.PlanApplicationRequest.parse_obj(request.json or {})
        with util.scoped_state_sync() as state_sync:
            spec = create_plan_dag_spec(plan, state_sync)
    except Exception as ex:
        return _error(str(ex))
    Variable.set(common.plan_dag_spec_key(spec.request_id), spec.json())
    return make_response(jsonify(request_id=spec.request_id), 201)